[PHP] Help-Updating multiple records From: Adriano Manocchia (am33 <email protected>)
Date: 09/21/00

I'm not sure if this is more of a PHP or MySQL question, but I'm hoping I can get some help with it here.

I've got a form being generated from a MySQL query that shows several record names and makes an input box for each record. After it, there's a submit button. My problem is I can't figure out how to make it update the field of each of the records shown from the data in the input boxes by just pressing the one submit button.

Suspect bit of code:

 if ($submit) {
  $sql="UPDATE samples SET (quality) VALUES ('$quality') WHERE id='$id'";
  $result=mysql_query($sql);
  echo "<b>Info added.</b>";
}

elseif ($number) {
   echo "<form method='post'>";
   $result=mysql_query("SELECT * FROM samples WHERE ordnum='$number'",$db);
   while ($myrow = mysql_fetch_array($result))
{
printf("%s <input type='text' name='quality' size='50' maxlength='100'><br>",$myrow["name"]);
}

echo "<br><input type='submit' name='submit' value='Enter quality info'><br></form>";
}

So I want to update all the "quality" fields of each of the displayed records. I know this doesn't work as-is, but if anyone has any ideas of how I might be able to do that with just the one submit button, I'd love to hear it. Thanks.

Age

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe <email protected>
For additional commands, e-mail: php-general-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>