Re: name already in use....

From: Date: Fri, 24 Nov 2000 09:37:35 +0000
Subject: Re: name already in use....
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-26917@lists.php.net to get a copy of this message
$myconnect = mysql_connect("hostname:port:socket","foob","bar"); $myresult = mysql_db_query("database","select name from foobar order by name desc"); while($myarray = mysql_fetch_array($myresult)): if($forminputnames == $myarray[name]): die("This name is already logged in"); endif; endwhile; // Mattias aka efnet's #php bad2da ----- Original Message ----- From: "Thomas Edison Jr." <thomasedisonjr@yahoo.com> To: <php-general@lists.php.net> Sent: Friday, November 24, 2000 10:26 AM Subject: [PHP] name already in use.... > i'm building a chatroom. there's one problem of > duplicate names. I cannot make the 'name' field a > primary key due to some reason. i want to check the > incoming name being entered with all the names > previously entered in each row of the 'name' field and > give a desired response if the name already exists. > > I tried with mysql_fetch_array ... but it's only > checking with the first row's data ..and not going to > the rest of the rows.... > > help appreciated!! > > T. Edison jr. > > > ===== > Rahul S. Johari (Director) > ****************************************** > Abraxas Technologies Inc. > Homepage : http://www.abraxastech.com > Email : abraxastech@yahoo.com > Tel : 91-4546512/4522124 > ******************************************* > > __________________________________________________ > Do You Yahoo!? > Yahoo! Shopping - Thousands of Stores. Millions of Products. > http://shopping.yahoo.com/ > > -- > 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 (#26917) next »