Following is my sql query:
$result = mysqli_query($con,"SELECT url,img_url,sentiment,title,category from invite_page where category='".$category."' where today = '".$today."' order by rt_count desc limit 3 ");
while ($row = @mysqli_fetch_array($result))
{
$url = $row['url'];
$img_url = $row['img_url'];
...
}
I am displaying this fetched values to user in some display box.
Problem is in few rows
titleandimg_urlfields are empty in database. I want to fetch only those record where all fields are filled. How to to this?If there are not 3 records for
today = '".$today."'then it should take records in desc order of today. (desc order of rt_count should also persist. I want to show record starting from max value to lower)
How to do this?