homepage Welcome to WebmasterWorld Guest from 54.211.230.186
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Hardware and OS Related Technologies / Linux, Unix, and *nix like Operating Systems
Forum Library, Charter, Moderators: bakedjake

Linux, Unix, and *nix like Operating Systems Forum

    
MySQL-command + REMOTE_ADDR
jacobp

5+ Year Member



 
Msg#: 1478 posted 9:58 pm on Jun 9, 2005 (gmt 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

 

jacobp

5+ Year Member



 
Msg#: 1478 posted 5:42 am on Jun 10, 2005 (gmt 0)

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

Jacob

lZakl

10+ Year Member



 
Msg#: 1478 posted 12:08 am on Jun 13, 2005 (gmt 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

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Hardware and OS Related Technologies / Linux, Unix, and *nix like Operating Systems
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved