2015-10-05 09:47:55
0
one of the SQL Queries i am using to create pagination among returned results is giving me grief and im unsure as to why, i am presented with this error:
Fatal error: Call to a member function fetch_assoc() on boolean in
---etc ,
which is referring to the query i have below. However, this select statement works perfectly fine in the sense that it displays all the results, but when the LIMIT is added:
$messagequery = 'SELECT m.id, m.msg_date, m.uname,CONCAT(o.firstname, \' \', o.surname) AS \'org_name\', m.email, m.message, m.response
FROM messages AS m
JOIN admin AS o ON m.uname = o.uname
WHERE uname = "'.$_SESSION['uname'].'"
LIMIT $start_from, $num_rec_per_page';
//execute the query
$results = $db->query($messagequery);
-
LIMIT $start_from, $num_rec_per_page';
I recieve the error...
I have done the same thing on multiple pages, and it works, but for this specific page i just cannot figure out why....