Jump to content

mysql_num_rows stops script


ratcateme

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/97724-mysql_num_rows-stops-script/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.