Web Hosting Talk







View Full Version : MySQL UPDATE


lilnomad
10-17-2006, 09:53 PM
I am having trouble with the UPDATE command, if anyone could help that would be lovely. My code is: mysql_query("UPDATE writings SET titleofpiece='$newtitle' WHERE pieceid='$id'");

Is there anything wrong with that? I put it in a if statement and it says it executes but it just is not saving, eh? Anyone guidance would be appreciated.

lilnomad
10-17-2006, 11:18 PM
Here is some more code.
$newtext=$_POST['editpiece'];
$newtitle=$_POST['editname'];
if($newtext && $newtitle)
{
$sql="UPDATE writings SET titleofpiece='$newtitle', thepiece='$newtext' WHERE pieceid='$id'";

mysql_query($sqlt);
}

lilnomad
10-18-2006, 12:34 AM
i used error_reporting(E_ALL); and figured it out myself thanks to Sheps