I have some text in a MySQL database like Test "Test"
Yet when I extract it into an html text input box, it will not display anything past the first quote.
For example:
$MyQuery2="SELECT * FROM $Product_DB WHERE ID=\"$Edit_ID\"";
$result2=mysql_query("$MyQuery2");
$num2=mysql_num_rows($result2);
$i=0;
while ($i < $num2) {
$Review_ProdName=mysql_result($result2,$i,"ProdName");
retrieves it from the database.
<input type=\"text\" size=\"40\" name=\"Edit_Prod_Name\" value=\"$Review_ProdName\">
Is my html form. Now what this outputs (when viewing source) shows:
<input type="text" size="40" name="Edit_Prod_Name\" value="Test ">
And there is no "Test".
If I try to addslashes when pulling it from the database, I get this instead:
<input type="text" size="40" name="Edit_Prod_Name\" value="Test \"Test>
Somehow the second \" and " is missing.
It works fine if I use a textarea field, but I do not want to use that field.
Any ideas?