Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

UPDATE multiple values - proper syntax? 1

Status
Not open for further replies.

frozenpeas

Technical User
Sep 13, 2001
893
CA
Hello,

I can't seem to figure out how to update multiple db entries in one query. Here are the methods I have tried (the bolded query works):

Code:
$query = "UPDATE sylvie_links SET link='$link',SET text='$text',SET type='$type',SET comment='$comment' WHERE id='$id'";

$query = "UPDATE sylvie_links SET link='$link' SET text='$text' SET type='$type' SET comment='$comment' WHERE id='$id'";

[b]$query = "UPDATE sylvie_links SET link='$link' WHERE id='$id'";[/b]

Thanks.

frozenpeas
 
Okay, got it. I don't know why I thought I needed to use SET for *each* value.

Code:
$query = "UPDATE sylvie_links SET link='$link',text='$text',type='$type',comment='$comment' WHERE id='$id'";

Thanks.

frozenpeas
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top