Can’t figure out why it is doing this - probably something really stupid, but…
[php]
$todaydate = $_SERVER[‘REQUEST_TIME’]; //current timestamp
//Check all active members
$db = mysqli_connect($db_hostname,$db_username,$db_password,“paratb_members”) or die (“Cannot Connect to database”);
$result = mysqli_query($db,“SELECT * FROM members WHERE active = ‘y’ AND exempt = ‘n’”) or die (“Cannot select from db”);
while ($row = mysqli_fetch_array($result)) {
extract($row);
if ($expiredate < $todaydate){
$query = “UPDATE members SET active=‘n’ WHERE (id = ‘$id’)”;
$result = mysqli_query($db,$query) or die(“A fatal MySQL error occured in the Member Database.\n
Error: (” . mysqli_errno() . ") " . mysqli_error());
echo “User $fname $lname ($id) active status changed to n
”;
unset($fname, $lname, $email, $id, $expiredate, $whendue);
}
}
[/php]
After performing the first function (e.g. User xxx xxx (138) active status changed to n) gives me this error:
Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in /home/paratb/public_html/admin/cron/duesreminder.php on line 68
line 68 is simply [php]while ($row = mysqli_fetch_array($result)) {[/php]
Any help would be greatly appreciated
Thanx