当我插入时可以说:
mysql_query("insert into table1 (title) values (\"date + book\")");
“+”号被转换为空格。所以它变成了“约会书”而不是“日期+书”
我应该怎么做才能将其按原样插入。 但如果我直接向 MYSQL 查询它,它会按原样接受它。 请消除我的困惑..谢谢
"UPDATE campus_bookinfo SET categoryid = ".$category.", bookversion = bookversion+1,
iAmount = \"".str_replace(",","",$price)."\", lectureName = '".$tag."', eStatus = 3 WHERE idx_campus_bookinfo = ".$id_bookinfo;
最佳答案
尝试这样:
mysql_query("insert into table1 (title) values ('date + book')")
或者如果它是一个变量:
mysql_query("insert into table1 (title) values ('$somevariable')")
关于PHP MYSQL : Insert "+" sign in MYSQL using PHP,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2242859/