PHP/MYSQL array help needed...?

Ranger Giya

New member
Hi guys...i need help with this problem...im trying to update all the rows of one column in a certain table...the row data is stored in an array...everything works...i just dont know what the syntax for the sql query is to update using an array...it gives me an error when i do the update query...im thinking its doesnt like the '$scores_array[]' in the query...please help...thanks in advance...

$scores_query = mysql_query("SELECT score FROM spaceuser")
or die(mysql_error());
$scores_array = array();
while($row = mysql_fetch_array($scores_query))
{
$scores_array[] = $row['score'] - ($row['score'] * 0.10) ;

$scores_update_query = mysql_query("UPDATE spaceuser SET score = '$scores_array[]'")
or die(mysql_error());
}
 
Back
Top