prashanth ag
asked on
Fatal error: Call to a member function fetch_assoc() on a non-object/ boolean
HI
Plz find the code
if manager_code = 1001, 2003 (numeric) works fine and don't get any error
Plz find the code
$query = "SELECT * FROM $this->_table_users WHERE manager_code = $manager_code AND date_leave = 0 ORDER BY emp_code DESC LIMIT $this->_offset,$this->_limit";
$query = mysqli_query($this->_dbconnect, $query);
$result = array();
$i = 0;
while($res = $query->fetch_assoc()){ //Error
$result[$i] = $res;
$i++;
}
return $result;
it shows Fatal error suppose manager_code =car1002, Xyz007, (alpha numeric value) if manager_code = 1001, 2003 (numeric) works fine and don't get any error
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
What is the output of var_dump()?
@julianH: Sorry, but I do not have enough time left in life to guess about what novice programmers are doing. That's why we ask pointed questions -- we want to lead them to the water, even if we cannot make them drink. I don't really care about the exact solution so much as teaching the process of finding the solution. I already know the solutions. I just want someone who asks a question here to leave with a new tool for finding the next solution! Sometimes that is a process of learning what question to ask of themselves, like, "What is in my variable?"
Open in new window