MySQL Forums
Forum List  »  Other Migration

Re: error message
Posted by: Nick Roper
Date: July 28, 2004 02:32AM

Ron,

First of all, you should be aware that $REMOTE_ADDR won't necessarily identify an individual user, as it returns an IP address. Depending on how the user is connecting to the internet, the ip address may indeed be unigue to them, but it could also be allocated dynamically or could be the ip address of a shared router.

With regard to the error, one thing that I use to try and get a handle on what the problem is as follows:

Change the code snippet as follows:

$ip_query = "select ip_addr from roster where ip_addr = '$REMOTE_ADDR'";

echo $ip_query;

$checkip = mysql_query($ip_query, $link);
$ipcount = mysql_num_rows($checkip);

When you hit submit you should see the SQL statement displayed on the page. This may identify the problem immediately but, if not, copy the statement into a text file, say '/my/dir/ip_query.sql' and then start a mysql client on the server and try:

mysql> source /my/dir/ip_query.sql

You can then edit the ip_query.sql file to fix the problem.

Note: If the mysql client returns an error, you can use perror from a shell prompt to get more info:

shell > perror errornumber

If you are still stuck, then please post the output from the echo command and also the table structure. You can display this in mysql with the following command:

mysql > show create table roster;

Nick



--
Nick Roper

Options: ReplyQuote


Subject
Views
Written By
Posted
4260
July 27, 2004 03:14PM
Re: error message
2222
July 28, 2004 02:32AM
2459
July 28, 2004 04:09PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.