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--> 
<? 
} 
?> 
<input type="submit" name="submit" value="Submit">
<snip>

Reply via email to