i create this Query: $query_big_collection = "select name,image,wallpapers,current_wallpapers,views from $wallpapers_list ORDER BY `current_wallpapers` DESC limit 0,6"; $get_big_collection = mysql_query($query_big_collection); if(! $get_big_collection){ error_data(); } else { echo "<h2>Biggest Collections:<br></h2><table width=505 align=center><tr><td>"; while($show_big_collection = mysql_fetch_array($get_big_collection, MYSQL_ASSOC)) { echo "<div style='display:inline;' class=img><a href='{$show_big_collection['wallpapers']}' title='{$show_big_collection['name']}'><img alt='{$show_big_collection['name']}' src='{$show_big_collection['image']}'/><div class=desc>{$show_big_collection['name']}</div></a></div>"; } echo "</td></tr></table>"; } function error_data() {echo "<h1 align=center>Oops!<br>Something Wrong With this Page. Please Refresh or Contact us if you are facing same problem.</h1>";} PHP: Its Displaying Wrong Result.. like as 1st 88 Views 2nd 83 Views 3rd 798 Views 4th 762 Views 5th 7 Views 6th 68 Views and i want to display it like this: 1st 798 2nd 762 3rd 88 4th 83 5th 68 6th 7 Please Help me, How do i fix this..? i know if i put 007,068,083,088 then the result will be printed right but I can't Change anything in "Viewes" Column because it will be added through "count(id)" Thanks For Any Help!
You need to order by whatever column 798, 762, 88 etc are in. "select name,image,wallpapers,current_wallpapers,views from $wallpapers_list ORDER BY `current_wallpapers` DESC limit 0,6"; Cheange the current_wallpapers to views I think. You must be missing some code in what you pasted or something though. The code you posted would not produce anything but a list of names.
Thanks but i want to display it according to current wallpapers. maximum wallpapers collection will be displayed first then lower and then lower..... Yes i don't write whole query here... Its too big... Another suggetions....??
If I have got your problem, please change your query: select name,image,wallpapers,current_wallpapers,views from $wallpapers_list ORDER BY `views` DESC limit 0,6
try LIMIT Capital is not Samul select name,image,wallpapers,current_wallpapers,views from $wallpapers_list ORDER BY `current_wallpapers` DESC LIMIT 0,6 PHP:
"LIMIT" only interested in the number of results displayedSo doesn't matter in your problem , The first point :which column responsible of results . The second point : Make sure type of this column "int" = current_wallpapers must be "int" type not "text" or "VARCHAR". Regards
YES, its Working..... i was using "longtext" data type Thanks Friend... i waste my so many hours but not did it and You Solved my Problem.... Thanks Again...!!!!