Here is the code:
<?php
//Starting session
session_start();
//Includes mass includes containing all the files needed to execute the full script
//Also shows homepage elements without customs
require_once ('includes/mass.php');
$username = $_SESSION['username'];
if (isset($username))
{
//Query database for the users networths
$sq_l = "SELECT * FROM user ORDER BY worth";
$sql_query_worth = mysql_query($sq_l);
while ($row = mysql_fetch_assoc($sql_query_worth))
{
$dbusername = $row['username'];
$dbworth = $row['worth'];
foreach ($dbusername as $dbuser)
{
echo ". USER: ".$dbuser." Has a networth of: ".$dbworth;
}
}
}
?>
There are three results. And here are the errors.
Here is the error msg:
Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\Mogul\richlist.php on line 32
Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\Mogul\richlist.php on line 32
Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\Mogul\richlist.php on line 32