I use this code to update a user's score.
<?php
mysql_connect("", "", "") or die(mysql_error());
mysql_select_db("") or die(mysql_error());
$data = mysql_query("SELECT * FROM table1 WHERE username='$username'")
or die(mysql_error());
while($info = mysql_fetch_array( $data ))
if ( $info['match_score_game1h'].$info['match_score_game1a'] == $info['game1h'].$info['game1a'] ) {
$result = mysql_query("UPDATE table1 SET game1='4' WHERE username='$username'" );
The $username is taken from login, however this means to update the whole database I have to input everyone's username into a login field one by one.
Is there a way to update all users in one go?
Just dropping the WHERE username = $username does not work, as all the users are updated with first user's score.
Thanks
Jon