-
墨色风雨
$conn = mysql_connect('127.0.0.1','root','123');mysql_select_db('test',$conn);$sql = "INSERT INTO `test` ( `insertTime`, `comment`) VALUES (now(), '1')";$query = mysql_query($sql);var_dump($query);
-
莫回无
把 $sql="UPDATE `user_activity` SET `su` = 'a:5:{i:41;s:9:"还不错";i:54;s:9:"还不错";i:45;s:9:"还不错";i:47;s:9:"还不错";i:49;s:9:"还不错";}' WHERE `u_id` =52 AND `a_id` =7;";改成把 $sql="UPDATE `user_activity` SET `su` = 'a:5:{i:41;s:9:\"还不错\";i:54;s:9:\"还不错\";i:45;s:9:\"还不错\";i:47;s:9:\"还不错\";i:49;s:9:\"还不错\";}' WHERE `u_id` =52 AND `a_id` =7;";
-
繁花如伊
把双引号用\转义例如:$con->query("insert into table(id,name) values(1,'aa\"bb')");