[php][mysql] UPDATE function

taekwondokid42

New Member
Messages
268
Reaction score
0
Points
0
mysql_query("UPDATE wiki_quotes SET Quote = '$Quote' WHERE id = \"$counter\"");


That line of code is a working line of code.

I need to set a column named Submitted By equal to another variable.

If I try...

...SET 'Submitted By' it gives me an error becuase of the 's

...SET Submitted By it gives me an error becuase of the space

...SET \"Submitted By\" it gives me an error because of the quotes.



Does anyone have any other suggestions?
 

Bryon

I Fix Things
Messages
8,149
Reaction score
101
Points
48
("UPDATE `wiki_quotes` SET `Quote` = '$Quote', `Submitted By` = '$submittedBy' WHERE `id` = '$counter'");
 
Top