- Home
- Tutorials
- Flash
- Intermediate
- Populating a MySQL Database using MS Excel

phpMyAdmin
Go to phpMyAdmin and select your database and table. If you haven’t created a table yet you can use this code:
CREATE TABLE `verbORadj` (
`id` int(11) NOT NULL auto_increment,
`word` varchar(25) NOT NULL default '',
`type` varchar(25) NOT NULL default '',
`not` varchar(25) NOT NULL default '',
PRIMARY KEY (`id`)
) TYPE=MyISAM ;
The way I got that was I went to another table that had a similar structure and exported the table structure. Then I exported one line of data so I knew I had the exact SQL line.
First I clicked the Export Tab, then the Export -> SQL option on the left. Then I unchecked Data and selected Structure. You can do both at once as well. The Structure option resulted in the above CREATE TABLE code, which I know is error free. I then changed the table name and data fields to fit my new table. Of course you can also manually create a table on the main page.
So back to the SQL query box. Select the SQL tab (mine is 3rd from the left. You should see something like this:
Erase the SELECT statement and paste in either the CREATE TABLE code, or the data from column F in the spreadsheet and click Go.
For 20 rows this is not a big deal, but when you populate 500 – 1,000 in about 2 seconds, you’ll really understand the beauty of it all.
Spread The Word
Article Series
-
Populating a MySQL Database using MS Excel

