check
| From: | bryan | Date: | Tue, 24 Oct 2000 17:55:46 +0000 |
| Subject: | check | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-3863@lists.php.net to get a copy of this message | ||
I am trying to count through my records to verify a username. If it is
already in my Database, print username is already taken. I am having
trouble getting my results to come up correctly. here is my code:
mysql_select_db("test",$dbcnx);
$query = "SELECT * FROM members where username='$username'";
$result = mysql_query($query,$dbcnx) or die("Error in query");
$numrow = mysql_num_rows($result);
$count = count($numrows);
if ($count != 1) {
print "This is a valid username";
} else {
print "User-name already in use!";
}
Does this even make since? i feel as if I am being over-redundant calling
count($numrows), but my logic could be bass-ackwards. Any help or critique
would be appreciated!
thanks
bryan