hi ppl,
im trying to log IP addresses soon as sum1 logs onto my site, and store them into a DB, but im not sure what the query would look like?
i think that $_SERVER["REMOTE_ADDR"] holds the ip add, is that right? what would the insert statement look like for this?
inserting IP ADD into Mysql
Moderator: General Moderators
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
to simple add an ip to the database it would look something like
notice that INS-ERT should be INSERT, some problems with the server wont allow me to type it properly
Code: Select all
$sql = "INS-ERT INTO `ips` SET `ip` = '".$_SERVER['REMOTE_ADDR']."'";notice that INS-ERT should be INSERT, some problems with the server wont allow me to type it properly
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
I tried finding the thread, but feyd narrowed the problem down to a few words that arn't being accepted.cto1mac wrote:I tried to post that reply like 6 times, but, it kept erroring out. Is the insert the problem?
edit: i found it
viewtopic.php?t=27017