got this code and it not working not sure where i have gone wrong
what i want it to do is get all the userid for minileaguemember table and then get all the info from standings where the userid = userid as well as the standing table joined with the users table so i can get the users username ect
any help on this please
thank you ....
$minileaguemembers_query = mysql_query("SELECT * FROM ". $tbl_prefix ."minileaguemembers WHERE mid='1'");
$minileaguemembers =array();
while($minileaguemembers_row = mysql_fetch_array($minileaguemembers_query)){
$minileaguemembers['userid'] = $minileaguemembers_row['userid'];
}
$query = mysql_query("SELECT *,u.* FROM ". $tbl_prefix ."standings AS s LEFT JOIN ". $tbl_prefix ."users AS u ON (u.userid = s.userid) WHERE s.userid ='".$minileaguemembers['userid']."' && s.lid='0' ORDER BY points DESC, diff DESC");
$position = '0';
$displaystandings = array ();
while($line = mysql_fetch_assoc($query)){
if ($line['pld'] > 0) {
$percentage = round($line['won'] / $line['pld'], 2); ;
}
$position++;
$displaystandings[] = array (
'lid' => $line['lid'],
'userid' => $line['userid'],
'username' => $line['username'],
'pld' => $line['pld'],
'won' => $line['won'],
'drawn' => $line['drawn'],
'lost' => $line['lost'],
'gfor' => $line['gfor'],
'gagainst' => $line['gagainst'],
'diff' => $line['diff'],
'points' => $line['points'],
'month' => $line['month'],
'position' => $position,
'percentage'=> $percentage
);
}