when i am using this insert script, i get an error when i try and insert single quotes around words.
double quotes insert fine. why is this?
my feild type is ' text ' in mySQL
the parts of my insert script that involve the feild are
$P_Desc = stripslashes($_POST["P_Desc"]);
Code: Select all
$sql = "INSERT INTO planes (P_Stock, P_Name, P_Cat, P_Scale, P_Length, P_Span, P_CostPrice, P_Price, P_Desc) VALUES ('$P_Stock','$P_Name','$P_Cat','$P_Scale','$P_Length','$P_Span','$P_CostPrice','$P_Price','$P_Desc')";
$result = mysql_query($sql, $db) or die ("Insert Plane :: Execution failed.");this is a error message when i put single quotes in this feild
if anyone could help me so i can insert single quotes that would be awsome!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 'test'' WHERE P_Stock='12334'' at line 1
Couldn't execute query: UPDATE planes SET P_Name='Test',P_Cat='0',P_Scale='54',P_Length='54',P_Span='54',P_CostPrice='54',P_Price='54',P_Desc='This is a "test" and another 'test'' WHERE P_Stock='12334'