Codice PHP:
$id_file = md5("...");
$id = md5("...");
$user = mysql_escape_string(serialize($this->USER_INFO));//$this->USER_INFO è un array
$query = "INSERT INTO tabella (id,id_file,last_time,user) VALUES ({$sid},{$id_file},{$this->_TIMENOW},{$user})";
echo $query."
";
$result = mysql_query($query,$GLOBALS['DB']['db1']) or die("errore insert
".mysql_error());
questo è il risultato:
la query stampata dall'echo:
INSERT INTO sys_sessione (sid,id_file,last_time,user) VALUES (f4857cab77875826eab01cf6c6f4868c,ba5509211a6c4e5e 09e326b95cfe40d0,0.48397300 1133180351,a:7:{s:2:\"ip\";s:9:\"127.0.0.1\";s:10: \"user_agent\";s:87:\"Mozilla/5.0 (Windows; U; Windows NT 5.1; it-IT; rv:1.7.12) Gecko/20050919 Firefox/1.0.7\";s:3:\"url\";s:23:\"127.0.0.1/index.php\";s:7:\"referer\";s:0:\"\";s:10:\"start_ time\";s:21:\"0.48397300 1133180351\";s:8:\"username\";s:0:\"\";s:6:\"group s\";a:0:{}})
e questo è l'errore che ritorna
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 '1133180351,a:7:{s:2:\"ip\";s:9:\"127.0.0.1\";s:10 :\"user_agent\"
qual'è st'errore? :master: