Minase Posted August 4, 2008 Share Posted August 4, 2008 i do have this query SELECT * FROM `" . DBPREFIX . "users` ORDER BY Level DESC Limit 0,50 it works good,but the results are weird ??? it display the results by the order they are in table,not by what i select .dont have a clue why Quote Link to comment Share on other sites More sharing options...
Stefan Posted August 4, 2008 Share Posted August 4, 2008 I like the way you are thinking but you are very unclear (it could be just me but .. ) on what you are asking. Can you be more specific? :-\ If you are NOT getting any errors, it could be the way you stated your query. The only thing that catches my eye is that there should be full stop between your database name and the table name. e.g. mysql_query(SELECT * FROM database.table ORDER BY `Level` DESC LIMIT 0 , 50); "please don`t rely on this code to be correct its just for e.g. purposes only" Quote Link to comment Share on other sites More sharing options...
Stefan Posted August 4, 2008 Share Posted August 4, 2008 you are very unclear on what you are asking.(it could be just me but . . ) The only thing that catches my eye is, database name should contain a full stop after the table name. Quote Link to comment Share on other sites More sharing options...
Minase Posted August 4, 2008 Author Share Posted August 4, 2008 DBPREFIX is just a prefix like "prefix_users" when im using order it work,but 50% it select what it need (no error) but it doesnt order by what i want (Level in my case) if i use ORDER BY Level DESC it return just how the records in prefix_users are but from the last to the first,if i use asc from first to last,how they are in table (its like ignoring my order syntax ) Quote Link to comment Share on other sites More sharing options...
Stefan Posted August 4, 2008 Share Posted August 4, 2008 Sorry about the double post! 1) Can you post the hole query? 2) Which version are using? Quote Link to comment Share on other sites More sharing options...
Minase Posted August 4, 2008 Author Share Posted August 4, 2008 that is the whole query i did try to debug and weird no problem,but even if i run the code into phpmyadmin it return same result $ranking = mysql_query("SELECT * FROM `" . DBPREFIX . "users` ORDER BY Capture DESC Limit 0,50") or die(mysql_error()); mysql MySQL 5.0.51b Quote Link to comment Share on other sites More sharing options...
Stefan Posted August 4, 2008 Share Posted August 4, 2008 When I ran the query, it worked as I expected.(No funny stuff) I`m no expert but if the version your using is a BETA version it could be that. (Again could be but Ive had my problems with BETA) Try this link: http://dev.mysql.com/doc/refman/5.0/en/order-by-optimization.html What is it you are trying to do? if I may ask. Quote Link to comment Share on other sites More sharing options...
fenway Posted August 6, 2008 Share Posted August 6, 2008 Post the query you run vs. the query from phpmyadmin. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.