Hello there
I have question about how to update multi row in MySQL database, I used while function but this do the job with more time and no indecator when to finish the work,
is there any efficient way to update like 1000 row with one button and make indecator to see the progress of work ?
I used this code
if(isset($_POST['update'])) {
$update=$_POST['update'];
$sql = "SELECT user FROM users";
$query = mysql_query($sql)or die(mysql_error());
while($found = mysql_fetch_array($query))
{
$psn = New psn();
$psnUser = $psn->get_jid($found['user']);
$gold = $psnUser [0]['gold'];
$silver = $psnUser [0]['silver'];
$bronze = $psnUser [0]['bronze'];
$score = $psnUser [0]['points'];
$level = $psnUser [0]['level'];
$total = $psnUser [0]['total'];
$progress= $psnUser[0]['progress'];
$games=$psn->get_games($psnUser['jid']);
$totalgames= $games['totalGames'];
$sql="UPDATE `users` SET `level` = '$level',
`bronze` = '$bronze',
`silver` = '$silver',
`gold` = '$gold',
`total` = '$total',
`score` = '$score',
`progress` = '$progress',
`totalg` = '$totalgames' WHERE `user` = '$found[user]' LIMIT 1 ";
$result=mysql_query($sql)or die(mysql_error());
echo $found['user'];
echo " ....... DONE <br>";
}