RE: [PHP] Updating Multiple rows with Combo Box!

From: Date: Mon, 22 Aug 2005 13:39:34 +0000
Subject: RE: [PHP] Updating Multiple rows with Combo Box!
Groups: php.general 
Request: Send a blank email to php-general+get-221085@lists.php.net to get a copy of this message
[snip] I guess the last query I tried was simply updating the database with the value of the Hired form field: $sql = "UPDATE contactdata SET hired='$hired' WHERE ID='$thisID'"; $result = mysql_query($sql) or DIE("Fatal Error: ".mysql_error()); I've tried using an array and running the query in a loop... Everything seems to just set the Hired field to "NO" for all records/rows, in the database, or not change anything at all! > <input type="hidden" name="thisID" value="<?php echo > $row_tjContactFormData['ID']; ?>"> [/snip] Have you echoed out the query to see that it is correct? Do you have register_globals ON? If not you need to use the $_GET or $_POST array depending on the form method.... $sql = "UPDATE contactdata SET hired= '".$_POST['hired']."' WHERE ID='".$_POST['thisID']."' ";

« previous php.general (#221085) next »