I am doing automatic member scrolling. I have two mysql queries, I want to display those who have a photo and are ordered by last login. so in the first set I have no problems since I do it like
$sql=mysql_query("SELECT *
FROM accounts
WHERE avatar != ''
ORDER BY lastlogin DESC
LIMIT 50");
It works great. But as the user scrolls and goes to the bottom of the page, I try to download the next set of 50 users ordered by the same filtering as above. Therefore, for this I do
$sql = mysql_query("SELECT *
FROM accounts
WHERE lastlogin < '$last_msg_id'
ORDER BY lastlogin DESC
LIMIT 50");
The above is used to search for the identifier of the last input ie the identifier of the 51st member from the last input. Now I need to filter out those elements that have a photo:
$sql = mysql_query("SELECT *
FROM accounts
WHERE avatar != ''
ORDER BY lastlogin DESC
LIMIT 50");
Tell me how I can combine these two queries, as I have no success.