By the help of
mysqli_insert_id() in MySQLi extension
or
PDO->lastInsertId() in PDO
Reference: http://www.desilva.biz/mysql/insertid.html
By the help of
mysqli_insert_id() in MySQLi extension
or
PDO->lastInsertId() in PDO
Reference: http://www.desilva.biz/mysql/insertid.html
If you have a very large database, it is frustrating to restore/import it using HTTP as most probably there are transfer limit.
So, it is time to use the command prompt. Firstly, upload the sql file to an easily accessed folder(Windows/Linux). Then run the command:
mysql -u xxx -p -h SERVER_PATH DATABASE_NAME < file.sql
If the database is not created, you can create it first, by using:
CREATE DATABASE database_name;
To show all the tables in a selected database (currently working):
SHOW TABLES;
To show all the tables in ANOTHER database:
SHOW TABLES IN other_database;
To show a table who you forget the exact name, you may use the wildcard(%):
SHOW TABLES IN other_database LIKE “%salary%“;
Theme: Shocking Blue Green. Blog at WordPress.com.