EagerWolf Posted April 19, 2008 Share Posted April 19, 2008 Here is query: mysql_query("SELECT * FROM usertable WHERE s1='skupina' AND a='1' ORDER BY var1 DESC, var2 ASC LIMIT 42, 4") When query is executed no results is outputed... I have tried different options: mysql_query("SELECT * FROM usertable WHERE s1='skupina' AND a='1' ORDER BY var1 DESC LIMIT 42, 4") AND mysql_query("SELECT * FROM usertable WHERE s1='skupina' AND a='1' ORDER BY var2 ASC LIMIT 42, 4") works fine... The problem is when I add two or more variables in ORDER BY I get empty results... I found on google that it is something about indexig.. But didn't find any helpful... Thanks for your help! Matija Volk Quote Link to comment Share on other sites More sharing options...
Northern Flame Posted April 19, 2008 Share Posted April 19, 2008 how are you trying to output it? are you using mysql_fetch_array or mysql_fetch_object? just by running the query, you will not display any results. Quote Link to comment Share on other sites More sharing options...
EagerWolf Posted April 20, 2008 Author Share Posted April 20, 2008 obviously I am using mysql_fetch_array.. Quote Link to comment Share on other sites More sharing options...
Northern Flame Posted April 20, 2008 Share Posted April 20, 2008 obviously I am using mysql_fetch_array.. lol just making sure, you'd be surprised with the questions I've seen before, try running the query with mysql_error() to see if you get any errors reported back, mysql_query("SELECT * FROM usertable WHERE s1='skupina' AND a='1' ORDER BY var1 DESC, var2 ASC LIMIT 42, 4")or die("Error: ". mysql_error()); and if that doesn't work, try taking off the LIMIT statement just to see if anything gets reported back, mysql_query("SELECT * FROM usertable WHERE s1='skupina' AND a='1' ORDER BY var1 DESC, var2 ASC") Quote Link to comment Share on other sites More sharing options...
EagerWolf Posted April 21, 2008 Author Share Posted April 21, 2008 Hehe .. Yup i know there are some silly questions, but I we were all beginners once Ok .. the point is I've tried this as well ... And in all cases I got empty array ... which is confusing... 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.