0

OK this is driving me mad and it needs to be done for a deadline.

It is just a simple query to update a few database fields.

Here's the PHP for it.

$sql5 = "UPDATE videos SET title='$new_video_title' WHERE artist_id='$i' ";
				$query5 = mysql_query($sql5) or die( mysql_error() );
								
				$sql6 = "UPDATE videos SET path='$new_video_path' WHERE artist_id='$i' ";
				$query6 = mysql_query($sql6) or die( mysql_error() );
				
				$sql7 = "UPDATE videos SET desc='$new_video_desc' WHERE artist_id='$i' ";
				$query7 = mysql_query($sql7) or die( mysql_error() );

I am getting this error for the third query.

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='short shawn text' WHERE artist_id='36'' at line 1

The name 'desc' is correct. The field desc in the database is the last one. The other ones are updating fine.


Also this update query works fine:

$sql2 = "UPDATE impressions SET fname='$new_fname', sname='$new_sname', role='$new_role', text='$new_text', image='$image' WHERE id='$i'";
$query2 = mysql_query($sql2);

Please someone tell me they have had this problem. Any help at all is great.


Thanks.

2
Contributors
2
Replies
3
Views
9 Years
Discussion Span
Last Post by rickya100
1

desc is a keyword,
so change that name to any like desc1...
and try...

Votes + Comments
Thanks for the quick reply. Solved
0

Thank you soo much.

I didn't even think that that was a keyword. So stupid!

Anyway really appreciate it. Thanks

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.