Jump to content

PHP & MySQL Problems


EagerWolf

Recommended Posts

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

obviously  ;D

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.