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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.