I have a problem writing variables to my mySQL database using PHP. I am faerly new to php, and this problem seems to keep irritating me, so please help me hehe !! Thanks :D
When creating a var like:
Expand|Select|Wrap|Line Numbers
- $strSIP = $_SERVER['REMOTE_ADDR'];
Expand|Select|Wrap|Line Numbers
- $query = "INSERT INTO `sys_session` (`ID`, `syslog_ip`)" .
- " VALUES ('', $strSIP)";
- $result = mysql_query( $query );
You have an error in your SQL syntax near '.1.2)' at line 1(I have trunk'd some of the code..)
What is wrong here? when i print or echo the $strSIP it gives the perfekt xxx.xxx.x.x IP.. The mySQL database is set up in syslog_ip as varchar(128)..
Thanks for any reply.