How to check unique addresses?

0 like 0 dislike
3 views
When registering on the website, the user automatically is given a unique page address of format a website.OU/id***

Where *** id number of the row from the database.
Ie when registering in the database a new record is created of the format (name, surname, telephone and, accordingly, is automatically generated ID), from there take the id.

The question how to check the uniqueness of the address?

For example a person wants to change at id123 on durov

1. How to check using php or html rule where you can only use Latin characters, a symbol "_" and "."?
2. How to make that the user could not select the address format id124 (since the next was will receive this id and it is unacceptable that there was a conflict of addresses - each must be unique)?
3. How do implement a function such as for example, in vk?
by | 3 views

1 Answer

0 like 0 dislike

2. How to make that the user could not select the address format id124 (since the next was will receive this id and it is unacceptable that there was a conflict of addresses - each must be unique)?

it is very simple:
in DB query writing
$open ="SELECT * FROM `xxx`.`yyyy` WHERE `user` LIKE ";
The SQL API is that it has built-in functions, such as the matching base will look for in itself, and will return zero or unity, and you can handle the answer, if there is no match, then the wish of a distinguished person and to change the name, if there is no
by

Related questions

0 like 0 dislike
2 answers
0 like 0 dislike
5 answers
0 like 0 dislike
1 answer
asked May 21, 2019 by Timbeik
110,608 questions
257,186 answers
0 comments
33,868 users