MySQL Forums
Forum List  »  Newbie

Re: update multiple rows at once
Posted by: Jay Pipes
Date: July 03, 2005 11:39AM

Doesn't really have anything to do with MySQL, but...

Make sure the HTML element name property have []. This will allow you to process the elements on the server side as an array.

example assuming some MySQL associative array fetch called $row:

<input type="text" id="someID" name="location_id[<?php=$row['location_id'];?>]" value="<?php=$row['location_name'];?>" />

when processing, you can read:

<?php
foreach ($_POST['location_id'] as $location_id=>$location_name) {
echo $location_id;
echo $location_name;
}
?>

Jay Pipes
Community Relations Manager, North America, MySQL Inc.

Got Cluster? http://www.mysql.com/cluster
Personal: http://jpipes.com

Options: ReplyQuote


Subject
Written By
Posted
July 03, 2005 11:25AM
Re: update multiple rows at once
July 03, 2005 11:39AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.