Simple MYSQL command

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
wmarcy
Forum Newbie
Posts: 3
Joined: Fri Mar 23, 2012 3:25 pm

Simple MYSQL command

Post 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
whiterainbow
Forum Newbie
Posts: 11
Joined: Fri Mar 18, 2011 9:13 am

Re: Simple MYSQL command

Post 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.
Post Reply