I'm experiencing a problem updating a MySQL table. The code below is near the start of the script and checks to see whether or not the script is being run after being called from another script, or if it has just called itself. The $Previous5 and $Finish are the names of the buttons elsewhere in this script.
The part that's causing the problems is the UPDATE. When it's executed it exits with the die function. The SELECT, on the other hand, works.
I suspect that the problem is with a type mismatch or something (unless you can find a typo I haven't noticed). $info is populated from a textfield. The database table's 'info' column is a TEXT field. First time I've set a database column as a TEXT but it's needed in this case as $info could contain up to 500 words.
Any help on this would be appreciated.
Oh, and just FYI. $property_id is passed to the script both by a hidden field and through the URL by an external script.
if (($Previous5) || ($Finish))
{
$sql = "UPDATE temp_properties SET info = $info
WHERE property_id = $property_id";
$result = mysql_query($sql) or die ("Could not access temporary properties");
}
else
{
$sql = "SELECT info FROM temp_properties WHERE property_id = $property_id";
$result = mysql_query($sql) or die ("Could not access temporary properties");
}