Welcome to WebmasterWorld Guest from

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

php-mysql user creation problem

3:01 am on Aug 2, 2009 (gmt 0)

Junior Member

5+ Year Member

joined:Apr 12, 2007
posts: 134
votes: 0


my case is i am trying to create one member database whose column username must be unique (I have made the required changes in table attribute so that it does not allow the duplicate entries to be inserted in)
Now my problem is when user fails to create an account with existing username how can I inform him that same username exists and he needs to choose different username. I mean mysql_query() function return anything using which we can figure out what same username exists in database apart from insert is failed.


6:14 am on Aug 2, 2009 (gmt 0)

Senior Member

WebmasterWorld Senior Member eelixduppy is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Nov 12, 2005
votes: 0

mysql_query will return false if the insert did not work, however, if you want to let the user know before the query they you are going to have to make a separate query to check for availability.