I'm pulling some info from a single table and its being populated in a dynamic table. There is a single field on every record that I want to change (each field will be different however and some may need to remain null).
Is it possible to have a single submit button and update all the fields that have something in them?
i.e. I'll have a mysql query dynamically populate a table with X number of rows, each row has a field I want to change and I'd like to do them all at once but only if there is something in the input textbox.
I don't know how I would get the mysql query to understand that each row was a different update. Anyone know?
If you need more info I'll try my best to re-explain
Thanx
Nico
This is what I was thinking, it obviously doesn't work, but hopefully you can get a better idea of what I'm trying to do.
$sql=mysql_query("SELECT srnumber,originalorder,date,newrplnumber,serialnumber FROM $table WHERE newrplnumber=0 ORDER BY $sort")
or die("Shizzle mah Nizzle..." . mysql_error());
while($res=mysql_fetch_array($sql)) {
?>
<tr class=normal>
<td><?=$res["date"];?></td>
<td><?=$res["originalorder"];?></td>
<td><?=$res["srnumber"];?></td>
<td><?=$res["newrplnumber"];?></td>
<td><?=$res["serialnumber"];?><? $serialnumber=$res['serialnumber'];?></td>
<td><input type='text' name='newrplnumber'></td>
<td align=center><input type='submit' value=Update><input type='hidden' name='submit' value='2'></td>
</tr>
<?
}
?>
</table></td></tr></table>
<?
if($submit==2) {
$sql1=mysql_query("UPDATE $table SET newrplnumber='$newrplnumber' WHERE serialnumber='$serialnumber'")
or die("dammit... " . mysql_error());
}else{print "wtf happened?";}