Jump to content

Update Multiple Fields


ririe44

Recommended Posts

I see how that'd work, but in my case every field will be different...

 

For example...

("UPDATE `$tbl_name` SET `amount` = '$budg_mustang' WHERE `sub_category` = 'Mustang'");

("UPDATE `$tbl_name` SET `amount` = '$budg_vulcan' WHERE `sub_category` = 'Vulcan'");

 

All 36 of them...

Any thoughts anyone?

 

If I have to do individual queries for each... would I just do something similar?:

 

$query_mustang = ("UPDATE `$tbl_name` SET `amount` = '$budg_mustang' WHERE `sub_category` = 'Mustang'");

$query_vulcan = ("UPDATE `$tbl_name` SET `amount` = '$budg_vulcan' WHERE `sub_category` = 'Vulcan'");

if (mysql_query($query_mustang, $query_vulcan)) {
    echo "Your budget has been updated!  <br> Would you like to make another modification?  <a href='budg_retrieve.php'>Yes</a>";
}else {
    die(mysql_error());
}

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.