[SOLVED] String problem
Posted: Mon May 16, 2005 11:13 pm
Let say i have 2 string variables:
If i execute query1 and query2, query1 is successed and query2 is failed. This is because in string $b, there is a character ('). So anybody knows how to solve this problem? I mean the problem if we want to save a string variable that contain a character (').
Code: Select all
$a = "Book of student";
$b = "Student's book";
$query1 = "INSERT INTO table1 (str1) VALUES ('$a')";
...
$query2 = "INSERT INTO table1 (str1) VALUES ('$b')";
...