Jump to content

Update with more than one variable?


tmp_

Recommended Posts

I have a forum software I've almost completed, but I need for the admin panel to update a user's entry all at once, I tried something like this:

 

$query = "UPDATE users SET id='$id', username='$nam', password='$pass', email='$email',  registerdate='$reg', lastlogin='$log', title='$title', status='$stat' WHERE usernamename = '$user'";

mysql_query($query) or die(mysql_error());

 

But no matter what I put the table isn't updated. I tried SET id='$id' AND username = '$nam' with all AND's instead of commas, but they don't update the query still, how do I update more than one column at the same time?

 

I can't find anything online that does this :(

Link to comment
https://forums.phpfreaks.com/topic/197053-update-with-more-than-one-variable/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.