here my username is know as callsign

there is a problem somewhere that i cant find

and i present the code:

        $callsign = mysql_real_escape_string($_POST["CallSign"]);

        $result = mysql_query("SELECT * FROM users WHERE CallSign = '$callsign'");

        $row = mysql_fetch_array($result);

        echo $row['CallSign'] . "<br>";

        $sql = "SELECT COUNT(*) FROM users WHERE CallSign = '$callsign'";
        $result = mysql_query($sql) or die('error');

        if($result > 0)
        {
            echo "That CallSign has been claimed Already!<br>";
            echo "<p><a href='register.php'>Return to Try Again</a><br>";
        }

mhmh, just a suggestion.. But I don't code like you:

<?php

   $callsign = mysql_real_escape_string($_POST['CallSign']);
   $query = "SELECT * FROM users WHERE Callsign='$callsign'";
   $result = mysql_query($query);
   if(mysql_affected_rows() == 1)
   {
        $row = mysql_fetch_row($result);
        echo $row[0] . "<br>";

   }else{
     echo "That CallSign has been claimed Already!<br>";
     echo "<p><a href='register.php'>Return to Try Again</a><br>";

   }


?>

I don't see what the problem is? Maybe it's something to do with your database table, how the field name is or something!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.