Refael
asked on
SQL syntax - IP address datatype
Hi experts,
I keep getting this error while trying to test a php form that insert data into (myisam) mysql database:
"Error entry: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.29.230' at line 9"
This line refers to IP address. I set the IP data-type to VARCHAR(15). So I am not really sure what's the problem?
I keep getting this error while trying to test a php form that insert data into (myisam) mysql database:
"Error entry: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.29.230' at line 9"
This line refers to IP address. I set the IP data-type to VARCHAR(15). So I am not really sure what's the problem?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
that is not the place where there is the problem.
please show the code that builds up the sql statement
please show the code that builds up the sql statement
ASKER
you were right!
the problem was here : IP= $IP";
should have been : IP= '$IP' ";
thanks!
the problem was here : IP= $IP";
should have been : IP= '$IP' ";
thanks!
ASKER
The IP is an auto insertion
In the form : <input type="hidden" name="IP" value="<?php echo $_SERVER['REMOTE_ADDR'] ?>" />
And $ip = stripslashes($ip);