php print from database after registartion

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

cipher143
New php-forum User
New php-forum User
Posts: 3
Joined: Wed Feb 20, 2013 1:52 pm

php print from database after registartion

Postby cipher143 » Wed Feb 20, 2013 1:59 pm

i have created a registration form page with id,name,col,branch,etc
Coming to the database ID is primary and auto increment,
im trying to print the generated value of from the database after the registration is done.

For example:
"You have Successfully registered with us n your id is xxxxxx"

Please someone helpme out with this

seandisanti
php-forum Fan User
php-forum Fan User
Posts: 838
Joined: Mon Oct 01, 2012 12:32 pm

Re: php print from database after registartion

Postby seandisanti » Mon Feb 25, 2013 10:24 am

It depends on how you've decided to interact with your database. If you're using PDO, then the id would be stored in PDO::lastInsertId, with mysqli, if you're using objects it would be in mysqli::insert_id procedural it would be returned with a call to mysqli_insert_id()


Return to “PHP coding => General”

Who is online

Users browsing this forum: Bing [Bot] and 1 guest