omg
omg

Reputation: 139842

How to generate a unique id for different visitors with PHP?

The value will be used as:

from INTEGER UNSIGNED NOT NULL

which defines different visitors that haven't login.

How to properly generate that number with PHP?

EDIT:

If using database as follows:

create table user_visits(
    id INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
    primary key(id)
);

How to insert a new record into it?

Upvotes: 0

Views: 1227

Answers (3)

codymanix
codymanix

Reputation: 29468

You can insert a value in a database each time with an auto_increment column.

You can also use the php function uniqid().

Upvotes: 0

soulmerge
soulmerge

Reputation: 75704

Use the id:

INTEGER UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT

Upvotes: 1

Related Questions