tags:

views:

48

answers:

1

when i insert let say:

mysql_query("insert into table1 (title) values (\"date + book\")");

the "+" sign is converted to a space. so it became "date   book" not "date + book"

what should i do to insert it as it is. but if i directly query this to MYSQL it accept it as it is.. please clear my confusion.. thanks

"UPDATE campus_bookinfo SET categoryid = ".$category.", bookversion = bookversion+1, 
iAmount = \"".str_replace(",","",$price)."\", lectureName = '".$tag."', eStatus = 3 WHERE idx_campus_bookinfo = ".$id_bookinfo;
+1  A: 

Try like this:

mysql_query("insert into table1 (title) values ('date + book')")

or if it is a variable:

mysql_query("insert into table1 (title) values ('$somevariable')")
Darin Dimitrov
i tried this already, but this doesn't work. also i tried \" coz the text is from a php variable so i concat it to the query text
Treby
please see my update
Darin Dimitrov
still doesn't work for me. i posted my sample query string
Treby