MDanz Posted June 7, 2010 Share Posted June 7, 2010 mysql_connect("localhost", "Master", "password"); mysql_select_db("db"); $checking = mysql_query("SELECT * FROM `Contribute` WHERE stack='$keywords' and username='$username'") or die (mysql_error()); $foundchecking = mysql_num_rows($checking)or die (mysql_error()); if($foundchecking==0) { $nextblock = "INSERT INTO Contribute"; $nextblock .= "(`username`,`stack`,`points`) VALUES ('$username','$keywords',1)"; $nextresults = mysql_query($nextblock)or die (mysql_error()); echo "work2"; } else { $nextblock2= mysql_query("UPDATE Contribute SET points=points+1 WHERE username='$username' and stack='$keywords'"); $nextresults2 = mysql_query($nextblock2)or die (mysql_error()); echo "work1"; } Quote Link to comment https://forums.phpfreaks.com/topic/204121-the-page-is-coming-up-blank/ Share on other sites More sharing options...
PFMaBiSmAd Posted June 7, 2010 Share Posted June 7, 2010 $foundchecking = mysql_num_rows($checking)or die (mysql_error()); mysql_num_rows() does not set mysql_error(), so your code is die'ing when there are zero rows in the result set but mysql_error() is nothing, so you get nothing output on your page. Putting or die() or or anything() on the end of a mysql_num_rows() statement does not make any sense. Quote Link to comment https://forums.phpfreaks.com/topic/204121-the-page-is-coming-up-blank/#findComment-1069095 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.