almightyegg Posted February 5, 2007 Share Posted February 5, 2007 I have this IF ELSE statement but it comes up with: Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/koggdesi/public_html/welcome.php on line 21 You haven't activated your account yet! <---this is true so it is working but saying it has an error aswell ??? $active = mysql_query("SELECT * FROM users WHERE email='$email' AND activated='1'"); $a = mysql_num_rows($active); if($a == 0){ echo "You haven't activated your account yet!"; }else{ //random stuff } anyideas? Quote Link to comment Share on other sites More sharing options...
Jessica Posted February 5, 2007 Share Posted February 5, 2007 Do this: $active = mysql_query("SELECT * FROM users WHERE email='$email' AND activated='1'") OR die(mysql_error()); It should print out a more descriptive error of the query. I don't see any errors, so perhaps a column is misspelled? Quote Link to comment Share on other sites More sharing options...
almightyegg Posted February 5, 2007 Author Share Posted February 5, 2007 Unknown column 'activated' in 'where clause' but the column is spelt like that too ??? Quote Link to comment Share on other sites More sharing options...
Jessica Posted February 5, 2007 Share Posted February 5, 2007 Are you sure? It's in the users table? Are you connecting to the right database, etc? Quote Link to comment Share on other sites More sharing options...
almightyegg Posted February 5, 2007 Author Share Posted February 5, 2007 id connected to the wrong database. Both have a users table so worked for a while :-X oops, thanks Quote Link to comment 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.