koolaidman52 Posted July 16, 2006 Share Posted July 16, 2006 i want to update an entire row of data in a DB heres what I'm trying in a nutshell$que = "UPDATE series SET (first_name, last_name, age) = ('$_POST[firstname]','$_POST[lastname]','$_POST[age]') WHERE name = '$name'";mysql_query("$que", $connection) or die('Error, query failed');It dies, is my syntax right? Link to comment https://forums.phpfreaks.com/topic/14784-update-a-lot-of-colums-at-once/ Share on other sites More sharing options...
ShogunWarrior Posted July 16, 2006 Share Posted July 16, 2006 The SQL Syntax is:[b]UPDATE table SET row_name='value' WHERE condition='value'[/b]Your query is:[code]$que = "UPDATE series SET first_name='{$_POST['firstname']}', last_name='{$_POST['lastname']}', age = $_POST['age'] WHERE name = '$name'";[/code] Link to comment https://forums.phpfreaks.com/topic/14784-update-a-lot-of-colums-at-once/#findComment-59050 Share on other sites More sharing options...
koolaidman52 Posted July 16, 2006 Author Share Posted July 16, 2006 ok it worked thanks Link to comment https://forums.phpfreaks.com/topic/14784-update-a-lot-of-colums-at-once/#findComment-59058 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.