Jump to content

why aren't all of the rows showing up?


acidglitter

Recommended Posts

on my site candy adds (http://candyadds.com/), the main page shows the vip members. ever since i added some new code that looks at how long they have left, its been having problems. its like my site gives up on running the entire mysql query and only shows half of the members. i have to hit refresh at least 5 times before it shows everyone.. does anyone know how i can fix this?

 

this is the query...

 

SELECT *,
HOUR(TIMEDIFF(vip,NOW())) AS 'hours',
MINUTE(TIMEDIFF(vip,NOW())) AS 'minutes'
FROM members
WHERE TIMEDIFF(vip, NOW()) >= 0
AND TIMEDIFF(vip, NOW()) REGEXP ! '-'
AND friendid NOT IN ($featuredspaces)	
GROUP BY friendid
ORDER BY DATEDIFF(DATE(vip), CURDATE()) DESC,
SUBTIME(TIME(vip), CURTIME()) DESC

Link to comment
Share on other sites

Ugh.

 

thankyou for your helpful reply and wonderful solution

 

 

Please run an EXPLAIN on this and post the results.

 

i.e.

EXPLAIN <rest of the select query here>

 

what is supposed to show up from adding EXPLAIN? everything thats showing up now is an error message..

Notice: Undefined index: hours in

Notice: Undefined index: minutes in

Notice: Undefined index: friendid in

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...
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.