i have a book form in which there is an ID field. i’d like the [disabled] textbox to display the ID from mysql when the user tries to fill the form.
it should check the database for the last id and accordingly display the next id. for example, if the last id entered is 8, then it should display to the new user- 9. how would i pre-generate the textbox to show the id?
Make the id column in MySQL
AUTO_INCREMENTso the id is increment automatically on every insert. Then get the inserted id throughPDO::lastInsertIdormysql_insert_id. No need to display to the user.