Skip to content Skip to sidebar Skip to footer

Update Mysql Db With Php Loop From Array

I want update a column in mysql with a loop. I have two arrays that are pulled from another database every 4 hours. The first has a station number that is in my db as an index. The

Solution 1:

I don't understand the way you describe your data, but if i base myself on the calls you make already, i can suppose that this will work:

for($i = 0; $i < count($nt); $i++) {
  mysql_query("UPDATE gages SET cfs = '".$nt[$i][2]."' WHERE sgs = '".$stano[$i][1]."'");
}

Post a Comment for "Update Mysql Db With Php Loop From Array"