Welcome to WebmasterWorld Guest from 54.145.65.62

Forum Moderators: bakedjake

Message Too Old, No Replies

MySQL-command + REMOTE_ADDR

     
9:58 pm on Jun 9, 2005 (gmt 0)

New User

10+ Year Member

joined:Mar 24, 2005
posts:14
votes: 0


Hello,

How can I get REMOTE_ADDR in the MySQL-command? - Google couldn't help me :(

mysql> SELECT * FROM [Table] WHERE Ipaddress = 'REMOTE_ADDR-command';

Jacob

5:42 am on June 10, 2005 (gmt 0)

New User

10+ Year Member

joined:Mar 24, 2005
posts:14
votes: 0


...or how can I get REMOTE_ADDR in the httpd.conf-file?
I want to use MySQL in http.conf.

Jacob

12:08 am on June 13, 2005 (gmt 0)

Preferred Member

10+ Year Member

joined:Dec 3, 2004
posts:445
votes: 0


MySql uses SQL, which is a querying language, thus can't store variables. You are going to need something to 'get' the IP of the user, and use whatever you used (I'll say you'll be using PHP) to query your database with the information gathered.

for example in PHP:

$ip = $_SERVER['REMOTE_ADDR'];

then your SQL query:

SELECT * FROM [Table] WHERE Ipaddress = '$ip';

If I understand you right, you are trying to do something that is beyond plain Structured Query Language.

-- Zak