Re: No same username

From: Date: Sun, 25 Feb 2001 14:51:06 +0000
Subject: Re: No same username
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-41587@lists.php.net to get a copy of this message
Or better using: create table test1 (t1 char(5), t2 char(5), primary key (t1), unique (t2)); when creating table. No duplicate records with the same t2 because it's unique. Ahmad Anvari ----- Original Message ----- From: Kath To: Brandon Feldhahn ; php-general@lists.php.net Sent: Sunday, February 25, 2001 6:19 PM Subject: Re: [PHP] No same username ------------ $sql = "SELECT username FROM main_users WHERE username = '$username'"; $result = mysql_query($sql); $num = mysql_numrows($result); if ($num > "0") { die ("That username already exists, please chose another"); } ----------------- That could do it :) - Kath ----- Original Message ----- From: "Brandon Feldhahn" <BrandonFeldhahn@earthlink.net> To: <php-general@lists.php.net>; <php-dev@lists.php.net>; <php-db@lists.php.net> Sent: Sunday, February 25, 2001 7:33 AM Subject: [PHP] No same username > how do i make somthing with my database that knows it the username > entered is already a name in use? > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#41587) next »