View Single Post
Old 08-07-2011, 07:00 AM  
cooldude7
Confirmed User
 
cooldude7's Avatar
 
Industry Role:
Join Date: Nov 2009
Location: Heaven
Posts: 4,306
Quote:
Originally Posted by redwhiteandblue View Post
$result = mysql_query("SELECT content.*, content_views.views AS views FROM content, content_views WHERE content_views.content = content.record_num AND content.approved = 2 AND content.enabled = 1 AND record_num<20000 ORDER BY encoded_date");

BTW defining an alias for content_views.views as "views" is pretty pointless in this query.
damn this worked like charm, thanks a lot.
so for fetching 20k to 40k should i do something like this .


$result = mysql_query("SELECT content.*, content_views.views AS views FROM content, content_views WHERE content_views.content = content.record_num AND content.approved = 2 AND content.enabled = 1 AND record_num>20000 AND record_num<40000 ORDER BY encoded_date");


thanks for your time.
cooldude7 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote