Hi there ive trying to make a game based on php and currently ive some
problems with this part of the script, i've tryed to fix it alone with out
success...
This is the script
<?php
include("db.php");
include("debug.php");
set_time_limit(0);
dbConnect("sessions");
$sqlUID = "SELECT UserID FROM Star_USER";
$UsersID = mysql_query($sqlUID) or die("Query failed");
while ($UserID = mysql_fetch_array($UsersID,MYSQL_ASSOC)) {
foreach ($UserID as $UID){
$sqlSz = "SELECT Size FROM Star_USER WHERE UserID = '$UID'";
$UserSize = mysql_query($sqlSz);
$OldUS = mysql_fetch_array($UserSize);
$AKA=$OldUS[0]
$UpdateSTR = mysql_query("UPDATE Star_USER SET NW='$AKA' WHERE
UserID='$UID'");
}
}
?>
What i wanted is that each time i run the script it will update the NW field
in the database based on the size of the player and this for each one of
them.
It all works if i take the select statment from inside the foreach, but i
need him there soo i can have the size of the player.
Anyone sees a problem with the script or do i need to find another away to
do it?
Thx
Marco