Don’t understand why I am getting 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 9
[php]1 require_once (’…/connect.php’);
2 $todaydate = $_SERVER[‘REQUEST_TIME’]; //current timestamp
3 $db = mysqli_connect($db_hostname,$db_username,$db_password,“paratb_members”) or die (“Cannot Connect to database”);
4 $result = mysqli_query($db,“SELECT * FROM members WHERE active = ‘y’ && exempt = ‘n’”) or die (mysqli_error());
5 while ($row = mysqli_fetch_array($result)) {
6 extract($row);
7 if ($expiredate < $todaydate){
8 $query = “UPDATE members SET active=‘n’ WHERE (id = ‘$id’)”;
9 $result = mysqli_query($db,$query) or die (mysqli_error()); ;
10 echo “User $fname $lname ($id) active status changed to n
”;
11 unset($id);
12 }
13 }
[/php]
The script actually does what it is supposed to but throws the error after every change it makes. NO mysqli error is defined. Funny thing is that if I comment out line 9, it cycles through without error so it is definately the successful query that causes the error?
Any suggestions?
Thanx