Re: Help Needed Please

From: Date: Wed, 04 Apr 2001 01:30:58 +0000
Subject: Re: Help Needed Please
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-46933@lists.php.net to get a copy of this message
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 > 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--> 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

« previous php.general (#46933) next »