ratcateme Posted March 25, 2008 Share Posted March 25, 2008 i am making a registration script but when it gets to the mysql_num_rows command it stops. here is my code <?php if (isset($_REQUEST['user']) && !empty($_REQUEST['user']) && isset($_REQUEST['pass']) && !empty($_REQUEST['pass']) && isset($_REQUEST['name']) && !empty($_REQUEST['name'])) { $con = mysql_connect('', '', '') or die(mysql_error($con)); mysql_select_db('mail', $con) or die(mysql_error($con)); $user = mysql_real_escape_string($_REQUEST['user'], $con); $query = "SELECT * FROM `users` WHERE `user` = '{$user}'"; $result = mysql_query($query, $con) or die(mysql_error($con)); echo "test1"; $count = mysql_num_rows($result) or die(mysql_error($con)); echo "test2"; all that gets outputted on my screen is "test1" when i should get "test1test2". any ideas i have made scripts like this before no problem i just cant see a problem. Scott. Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted March 25, 2008 Share Posted March 25, 2008 take the or die() off the mysql_num_rows() its only really needed on the query because if they query is valid and it of select nature mysql_num_rows is valid to work on said query resource Quote Link to comment Share on other sites More sharing options...
uniflare Posted March 25, 2008 Share Posted March 25, 2008 have a look in the error log file in apache and also try putting a @ symbol in front of the function. dont keep the @ symbol though, you shud never really need them, or use them Quote Link to comment Share on other sites More sharing options...
ratcateme Posted March 25, 2008 Author Share Posted March 25, 2008 thanks cooldude832 i removed the or die and it works now. Scott. 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.