I've been trying for the past couple of days to figure out why I kept getting an error on my update query in php/mysql.
This is the original query I was having trouble with:
The error stated:
$update="UPDATE videos SET title='$title', date='$date',
desc='$desc', image='$image', sample='$sample',
clip1='$clip1', clip2='$clip2', clip3='$clip3', clip4='$clip4',
clip5='$clip5', clip6='$clip6', clip7='$clip7', clip8='$clip8',
full='$full', active='$active' WHERE id='$_GET[id]'";
$updateresult= mysql_query($update) or die(mysql_error());
As soon as I added this character ( ` ) to my DESC section of the query it worked fine.
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 'desc='testing update do no', image='img.jpg',
sample='t543653et.wmv', clip1='t3' at line 1
like this: `desc`='$desc'
Can anyone explain to me why that character affected the query so that it would work when I didn't need to use that on any of the other parts of the query?