acidglitter Posted February 26, 2008 Share Posted February 26, 2008 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 Quote Link to comment https://forums.phpfreaks.com/topic/93151-why-arent-all-of-the-rows-showing-up/ Share on other sites More sharing options...
fenway Posted February 26, 2008 Share Posted February 26, 2008 Ugh. Quote Link to comment https://forums.phpfreaks.com/topic/93151-why-arent-all-of-the-rows-showing-up/#findComment-477217 Share on other sites More sharing options...
aschk Posted February 27, 2008 Share Posted February 27, 2008 Please run an EXPLAIN on this and post the results. i.e. EXPLAIN <rest of the select query here> Quote Link to comment https://forums.phpfreaks.com/topic/93151-why-arent-all-of-the-rows-showing-up/#findComment-477890 Share on other sites More sharing options...
acidglitter Posted February 27, 2008 Author Share Posted February 27, 2008 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 Quote Link to comment https://forums.phpfreaks.com/topic/93151-why-arent-all-of-the-rows-showing-up/#findComment-478408 Share on other sites More sharing options...
fenway Posted February 27, 2008 Share Posted February 27, 2008 That's not EXPLAIN output. And "refreshing 5 times" isn't an sql issue... unless your query takes forever to run.... hence the request for EXPLAIN output. Now it's your turn to be helpful. Quote Link to comment https://forums.phpfreaks.com/topic/93151-why-arent-all-of-the-rows-showing-up/#findComment-478424 Share on other sites More sharing options...
aschk Posted February 28, 2008 Share Posted February 28, 2008 Run that EXPLAIN query in MySQL directly (not in your PHP). Quote Link to comment https://forums.phpfreaks.com/topic/93151-why-arent-all-of-the-rows-showing-up/#findComment-478980 Share on other sites More sharing options...
acidglitter Posted March 10, 2008 Author Share Posted March 10, 2008 this is exactly what i have at the beginning mysql_query("EXPLAIN SELECT *, i googled it to make sure i'm doing that right and it looks like i am. but for some reason its still not doing anything different (just showing error messages) Quote Link to comment https://forums.phpfreaks.com/topic/93151-why-arent-all-of-the-rows-showing-up/#findComment-488119 Share on other sites More sharing options...
luca200 Posted March 10, 2008 Share Posted March 10, 2008 Run that EXPLAIN query in MySQL directly (not in your PHP). Quote Link to comment https://forums.phpfreaks.com/topic/93151-why-arent-all-of-the-rows-showing-up/#findComment-488384 Share on other sites More sharing options...
acidglitter Posted March 23, 2008 Author Share Posted March 23, 2008 Run that EXPLAIN query in MySQL directly (not in your PHP). How do I run it in MySQL directly? Quote Link to comment https://forums.phpfreaks.com/topic/93151-why-arent-all-of-the-rows-showing-up/#findComment-498837 Share on other sites More sharing options...
Yuki Posted March 23, 2008 Share Posted March 23, 2008 Do you have PhpMyAdmin? Can you connect to your mysql database at comand line? either will do. Happy easter I hid an easter egg in this thread. Quote Link to comment https://forums.phpfreaks.com/topic/93151-why-arent-all-of-the-rows-showing-up/#findComment-498842 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.