nope still not working.
heres the whole script
$link = mysql_connect("localhost", "username", "password");
$result = mysql_query($link);
@mysql_select_db("legacy");
//update turns
$sql2 = "UPDATE regents SET regent_turns=regent_turns+1";
$result2 = mysql_query($sql2);
$sql = "SELECT * FROM regents";
$result4 = mysql_query($sql) or die(mysql_error());
while ($row = mysql_fetch_object($result4)) {
// calculate income goldbars
echo "regent id: $row->regent_id<br>";
$result3 = mysql_query ("SELECT * SUM(prov_poplvl) AS Total FROM provinces WHERE prov_regentid=($row->regent_id)");
$row3 = mysql_fetch_array($result3);
echo "$row3->Total";
}
results of script:
regent id: 1
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\Program Files\Apache Group\Apache2\htdocs\scheduler.php on line 22
regent id: 2
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\Program Files\Apache Group\Apache2\htdocs\scheduler.php on line 22