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 Link to comment https://forums.phpfreaks.com/topic/101892-php-mysql-problems/ 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. Link to comment https://forums.phpfreaks.com/topic/101892-php-mysql-problems/#findComment-521444 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.. Link to comment https://forums.phpfreaks.com/topic/101892-php-mysql-problems/#findComment-521899 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") Link to comment https://forums.phpfreaks.com/topic/101892-php-mysql-problems/#findComment-522032 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... Link to comment https://forums.phpfreaks.com/topic/101892-php-mysql-problems/#findComment-523029 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.