quick sql query help

Associate
Joined
30 Nov 2003
Posts
1,614
I had this problem before and I cant remember what the problem was.

Heres the query:

Code:
$query = "UPDATE bootleg_info SET ". 
		"band = '$band' ".
		"venue = '$venue' ".
		"aud_vid = '$audvid' ".
		"shot_method = '$shot' ".
		"rec_date = '$recdate' ". 
		" WHERE boot_id = '$bootid'";

Which just tells me I have an error in the sql syntax.
 
Code:
$query = "UPDATE bootleg_info SET ". 
		"band = '$band', ".
		"venue = '$venue', ".
		"aud_vid = '$audvid', ".
		"shot_method = '$shot', ".
		"rec_date = '$recdate' ". 
		" WHERE boot_id = '$bootid'";
Commas! :)

What's with all the line breaks though?
 
after each field you update you need a comma i.e.

update TableName
set FieldName1 = 'Value1',
FieldName2 = 'Value2',
FieldNameInt = 4
where Table_id = 1
 
Back
Top Bottom