Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

php print from database after registartion

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

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
cipher143
New php-forum User
New php-forum User
 
Posts: 3
Joined: Wed Feb 20, 2013 1:52 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()
seandisanti
php-forum Fan User
php-forum Fan User
 
Posts: 838
Joined: Mon Oct 01, 2012 12:32 pm


Return to PHP coding => General

Who is online

Users browsing this forum: No registered users and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.