Drominus Posted December 20, 2011 Share Posted December 20, 2011 Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource on line 14. <?PHP require_once("dbcheck.php"); require_once("check.php"); $Username=$_COOKIE['Username']; $Password=$_COOKIE['Password']; $Nickname=$_COOKIE['Nickname']; $Username=mysql_real_escape_string($Username); $Password=mysql_real_escape_string($Password); date_default_timezone_set('Asia/Calcutta'); $action = $_GET['do']; $Result=mysql_query("SELECT * FROM Checks WHERE UserName='$Username'"); $Rowexist=mysql_num_rows($Result); if($Rowexist!=0){ while($Rows=mysql_fetch_array($Result)) { $Serial = $Rows['Serial']; $Banned = $Rows['Banned']; $IP = $Rows['IP']; $Used = $Rows['Used']; $First = $Rows['First']; $Duration = $Rows['Duration']; $Total = $Rows['Total']; $Time = $Rows['Time']; } if($action=="" || $action=="Banlist"){ mysql_query("UPDATE Checks SET NickName='$Nickname' WHERE UserName='$Username'"); ?> Quote Link to comment https://forums.phpfreaks.com/topic/253572-warning-mysql_num_rows-supplied-argument-is-not-a-valid-mysql-result/ Share on other sites More sharing options...
Pikachu2000 Posted December 20, 2011 Share Posted December 20, 2011 Your query is failing. mysql_error should help you figure out why. It would also be helpful to echo the query string to make sure it contains the values you'd expect it to contain. Quote Link to comment https://forums.phpfreaks.com/topic/253572-warning-mysql_num_rows-supplied-argument-is-not-a-valid-mysql-result/#findComment-1299914 Share on other sites More sharing options...
Drominus Posted December 20, 2011 Author Share Posted December 20, 2011 I actually cant understand what youre meaning.. Is there any ways you could make a preview Quote Link to comment https://forums.phpfreaks.com/topic/253572-warning-mysql_num_rows-supplied-argument-is-not-a-valid-mysql-result/#findComment-1299916 Share on other sites More sharing options...
melloorr Posted December 20, 2011 Share Posted December 20, 2011 I actually cant understand what youre meaning.. Is there any ways you could make a preview $Result = "SELECT * FROM Checks WHERE UserName='$Username'"; $Rowexist = mysql_query($Result); Quote Link to comment https://forums.phpfreaks.com/topic/253572-warning-mysql_num_rows-supplied-argument-is-not-a-valid-mysql-result/#findComment-1299917 Share on other sites More sharing options...
Drominus Posted December 20, 2011 Author Share Posted December 20, 2011 Now its a blank page. Quote Link to comment https://forums.phpfreaks.com/topic/253572-warning-mysql_num_rows-supplied-argument-is-not-a-valid-mysql-result/#findComment-1299920 Share on other sites More sharing options...
melloorr Posted December 20, 2011 Share Posted December 20, 2011 Now its a blank page. $Result = "SELECT * FROM Checks WHERE UserName='$Username'"; $queryresult = mysql_query($Result) or die(mysql_error()); $Rowexist=mysql_num_rows($queryresult); Quote Link to comment https://forums.phpfreaks.com/topic/253572-warning-mysql_num_rows-supplied-argument-is-not-a-valid-mysql-result/#findComment-1299922 Share on other sites More sharing options...
Drominus Posted December 20, 2011 Author Share Posted December 20, 2011 Table '******_forum.Checks' doesn't exist Quote Link to comment https://forums.phpfreaks.com/topic/253572-warning-mysql_num_rows-supplied-argument-is-not-a-valid-mysql-result/#findComment-1299925 Share on other sites More sharing options...
melloorr Posted December 20, 2011 Share Posted December 20, 2011 Table '******_forum.Checks' doesn't exist Thats pretty much self explanatory. The table Checks doesn't exist. Have you checked the database and made sure it does exist? Actually, have you connected to the database? Quote Link to comment https://forums.phpfreaks.com/topic/253572-warning-mysql_num_rows-supplied-argument-is-not-a-valid-mysql-result/#findComment-1299929 Share on other sites More sharing options...
Drominus Posted December 20, 2011 Author Share Posted December 20, 2011 Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/elitehax/public_html/GuidTech/members.php on line 17 *I added the Checks table. Quote Link to comment https://forums.phpfreaks.com/topic/253572-warning-mysql_num_rows-supplied-argument-is-not-a-valid-mysql-result/#findComment-1299934 Share on other sites More sharing options...
melloorr Posted December 20, 2011 Share Posted December 20, 2011 Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/elitehax/public_html/GuidTech/members.php on line 17 *I added the Checks table. Because it would not be $Result, it would be $queryresult. Quote Link to comment https://forums.phpfreaks.com/topic/253572-warning-mysql_num_rows-supplied-argument-is-not-a-valid-mysql-result/#findComment-1299937 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.