简体   繁体   中英

Insert New record id to url

Get the last record id inserted to db and pass to redirect url

my url is employeesview.php?showdetail=&id=

so id mus go after &id=

thanks

Question could be improved (eg what DB to be used, why do you think you have to provide the ID as HTTP GET argument, etc.)

But the answer could be easy. Just guessing you are using a mysql db (because php beginners often use mysql).. in this case please check auto_increment attribute for your ID column in sql. It allows that PHP automatically uses the next ID for your new records, and you don't need to provide the ID for inserting a new row.

See https://www.w3schools.com/sql/sql_autoincrement.asp

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM