On Thu, Jan 16, 2003 at 01:13:54PM -0300, Cesar Aracena wrote: > Hi all, > > I have this admin site where the administrators can add new ones of > their kind (admin level) and now I'm trying to make a query so no > usernames are duplicated in MySQL. > > The query goes like this: > > $query1 = "SELECT * FROM r2k_admin WHERE adminuser = $user";
Hello Cesar, A general tip for this kind of situation is: Try displaying the query you are running and then try to run the displayed SQL in the MySQL command line client. i.e. echo $query1, "\n"; However, for this specific problem, you need to quote $user in your query. Cheers! -- Zak Greant <[EMAIL PROTECTED]> | MySQL Advocate | http://zak.fooassociates.com Developing Dynamic Web Applications with MySQL and PHP MySQL Training: Nuernburg, June 02-06, 2003 Visit http://mysql.com/training for more information AdBusters: Creative Resistance to Consumerism (http://adbusters.org) --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php