tonyhhisc
asked on
Whats' wrong with this query?
$ins_result = mysql_query("SELECT * FROM users WHERE guest_faculty!='1' AND (faculty_courses LIKE '%,".$currUserCourse.",%' OR instructor_courses LIKE '%,".$currUserCourse.",%') ORDER by instructor_courses DESC");
while ($row = mysql_fetch_array($ins_res ult)) {
$row['ID'];
}
I'm getting this error:
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /var/www/vhosts/******/*** ***/*****/ httpdocs/s idebar_ins tructor.ph p on line 18
Line 18 is the "while()" line.
Thanks!
while ($row = mysql_fetch_array($ins_res
$row['ID'];
}
I'm getting this error:
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /var/www/vhosts/******/***
Line 18 is the "while()" line.
Thanks!
The query is surrounnded by double quotes, and then you also have double quotes in the query itself.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks a lot Frosty you rock!!!
(by the way, it was just a stupid error on my part.... guest_courses was not a field in the database -- I'm in panic mode here as we did an upgrade and working through PHP errors everywhere!!)
Cheers!
(by the way, it was just a stupid error on my part.... guest_courses was not a field in the database -- I'm in panic mode here as we did an upgrade and working through PHP errors everywhere!!)
Cheers!
I can't count the number of times this has happened to me. Dying properly on error, and printing out your SQL statements always makes the debugging process much easier. Glad to help :)