php - How to prevent duplicate users in a registration page? -


http://programmerguru.com/android-tutorial/android-multicast-push-notifications-using-gcm/

i still quite new php , mysql. doing project using gcm (google cloud messenging).

i have problem code when want register allows me register same username or email , big flaw in project. error having in file viewusers.php; there way can register , check database if there existing user same username if there is?

the app restrict user registering, , function check database see if there match user , display area user residing.

you can set username unique. stops being able create user username.

you can run query check if user there:

select * `your_table` `username` = "username register" 

then check how many results got. if resultcount higher 0, have stop registration-process.

to last question - same query before. sql-table has save it:

select * `your_table` `username` = "username check" 

also advice use dots. hard fight me through text.


Comments

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

Nuget pack csproj using nuspec -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -