I want to update 160 rows in MySQL table at once.
This approach works but it seems not optimize enough and sometimes it failed. It runs 160 queries, isn’t it? How to optimize this script?
FYI: pdfdones are data from Flash, not html form.
$done = array($_POST['pdfdone1'],$_POST['pdfdone2'],$_POST['pdfdone3'] ... $_POST['pdfdone160'])
$idx = array(1,2,3 ... 160)
$count = count($idx);
for($i=0;$i<$count;$i++){
$sql1="UPDATE $table SET pdfdone='$done[$i]' WHERE id='$idx[$i]'";
$result1=mysql_query($sql1);
}
Please help.