I have this code:
$id1=array($aa1,$aa2,$aa3,$aa4,$aa5,$aa6,$aa7);
$rank1=array($a1,$a4,$a7,$a10,$a13,$a16,$a19);
require_once("connection.php");
for($i=0;$i<7;$i++){
$sql = "update live_tracking set swim_rank = '"$rank1[$i]."' where id = '".$id1[$i]."'";
}
I want to update multiple rows of my mysql database but using the code above only the first index is being updated. Any suggestions?
where id=$id
you should havewhere id > $min AND id < $max
– meLove Feb 5 at 9:21