Help Needed Please
| From: | Peter Houchin | Date: | Tue, 03 Apr 2001 23:57:45 +0000 |
| Subject: | Help Needed Please | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-46919@lists.php.net to get a copy of this message | ||
Hiya i've got a script that basically draws values from a db and will display them, as i have
multiple records in there and want to display them all i'm using a
while ( ($myrow = mysql_fetch_array($result) ) )
statement this is all good as far as it will display them all how ever when i go to update the
fields i get id=++ instead of the actual id value ie 1, 2, 3, etc ..
any suggestions would be apreciated
Peter Houchin
peterh@sunrentals.com.au
<snip>
$rs = "UPDATE main SET system='$system',";
$rs .= "part='$part',";
$rs .= "monthly='$monthly',";
$rs .= "WHERE id=$id";
$result = mysql_query($rs,$db);
?>
<form name="update" method="get" action="../../ben.php">
<?
$foo = "SELECT * FROM main";
$result = mysql_query($foo);
while ( ($myrow = mysql_fetch_array($result,$db) ) ) {
$id = $myrow["id"];
$system = $myrow["system"];
$part = $myrow["part"];
$config = $myrow["monthly"];
?>
<!--form elements with echo on $myrow, and id hidden-->
<?
}
?>
<input type="submit" name="submit" value="Submit">
<snip>