Link to home
Start Free TrialLog in
Avatar of Refael
RefaelFlag for United States of America

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?
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Refael

ASKER

Hi,
The IP is an auto insertion

In the form : <input type="hidden" name="IP" value="<?php echo $_SERVER['REMOTE_ADDR'] ?>" />

And $ip = stripslashes($ip);
that is not the place where there is the problem.
please show the code that builds up the sql statement
Avatar of Refael

ASKER

you were right!

the problem was here : IP= $IP";

should have been : IP= '$IP' ";

thanks!