sintax63 Posted February 13, 2010 Share Posted February 13, 2010 I have this mysql_query in a good portion of my pages that counts to see how many states a user has been in by comparing entries from three separate tables. It has been working just fine until this morning when I pulled up the site to do some work on it. If anyone can offer some suggestions I would be greatly appreciative! $AL = mysql_result(mysql_query("SELECT COUNT(*) FROM users, tracking, profiles WHERE tracking.placeID = profiles.id AND tracking.userID = users.id AND tracking.userID = '$profileID' AND state='AL'"),0); the $profileID does return a valid variable so I know that isn't the issue. Quote Link to comment https://forums.phpfreaks.com/topic/191960-select-count-suddenly-stopped-working-i-have-no-idea-why/ Share on other sites More sharing options...
kickstart Posted February 13, 2010 Share Posted February 13, 2010 Hi When you say it no longer works, do you mean it fails or that it just brings back 0? All the best Keith Quote Link to comment https://forums.phpfreaks.com/topic/191960-select-count-suddenly-stopped-working-i-have-no-idea-why/#findComment-1011787 Share on other sites More sharing options...
sintax63 Posted February 13, 2010 Author Share Posted February 13, 2010 Sorry about that - I know better: Warning: mysql_result(): supplied argument is not a valid MySQL result resource in state-count.php on line 3 And it gives that error 50 times - one for each state... Quote Link to comment https://forums.phpfreaks.com/topic/191960-select-count-suddenly-stopped-working-i-have-no-idea-why/#findComment-1011789 Share on other sites More sharing options...
sintax63 Posted February 13, 2010 Author Share Posted February 13, 2010 Well after countless rewrites I got it working again. I am not sure why it worked all this time and then just stopped this morning. Yeah, yeah... I know it doesn't happen like that. $AL = mysql_result(mysql_query("SELECT COUNT(*) FROM users, tracking, profiles WHERE users.id='$profileID' AND tracking.userID='$profileID' AND profiles.id=tracking.placeID AND profiles.state='AK'"),0); Quote Link to comment https://forums.phpfreaks.com/topic/191960-select-count-suddenly-stopped-working-i-have-no-idea-why/#findComment-1011843 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.