On Wed, 4 Apr 2001 09:27, Peter Houchin wrote:
> 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
> [EMAIL PROTECTED]
>
> <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-->
This ^^^^ might be the place to start - what do you get when you view the
source??
> <?
> }
> ?>
> <input type="submit" name="submit" value="Submit">
> <snip>
--
David Robley | WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/
AusEinet | http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]