Page 1 of 1

Simple MYSQL command

Posted: Sun Mar 25, 2012 10:47 am
by wmarcy
I have a database, with 5 tables, one of them is named players

Inside of players I need to find out if a character_name is already used.

Does anyone know off the top fo their head the SQL command to do this?

Thanks

Re: Simple MYSQL command

Posted: Sun Mar 25, 2012 1:54 pm
by whiterainbow
you'd have to do something like SELECT character_name FROM players WHERE character_name = '$variable' , where variable is the value you're comparing to. If your query returns a row, that name is used.