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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.