Inserting SQL through Phpmyadmin
Inserting .sql files or mysql entries manually through phpmyadmin is something your eventually going to run across in your developer career. I am going to walk you through both methods of inserting tables or queries into a database in just a few short steps. The first thing you need to do before we even get started though is figure out how to access your phpmyadmin interface.
Working with .SQL Files
Your going to run across some mods that are released with a .sql file containing the necessary tables to store information. Working with these are simple.
The Contents
If you were to open a .sql file you would probably see something like the below.
-- -- Table structure for table `nuke_sf_slider` -- CREATE TABLE IF NOT EXISTS `nuke_sf_slider` ( `slid` int(11) NOT NULL auto_increment, `title` varchar(255) default NULL, `longdesc` varchar(255) default NULL, `shortdesc` varchar(255) default NULL, `url` varchar(255) default NULL, `image` varchar(255) default NULL, PRIMARY KEY (`slid`) ) ENGINE=MyISAM
It is not a very optimized example, but it serves the purpose.
Insertion Method #1 (Pasting)
The first method is simply pasting the code from within the .sql file you received. How you ask? In PhpMyAdmin, select the database you wish to insert the queries/tables into by clicking on it in the far left sidebar.

After clicking your desired database, you want to hit the SQL tab located at the top in the right hand side panel.

As you can see I have already pasted the contents from the .sql file. The last step is to hit GO down in the bottom left hand corner.
Noob Note: You can also paste the commented text into the query box because the engine will just ignore any commented text. Commented text looks like this – - Commented Text. Basically, it is always prefixed with dashes.
If you get an error after you hit GO you should recheck your steps and contact the author if error can not be resolved.
Insertion Method #2 (Uploading)
After you have selected your desired database, you need to find the Import Tab located at the very top on the right hand side panel.

Next you are going to click browse and select your .sql file. The last step is to hit GO in the bottom left hand corner. You should be done and if you have specific questions about a .sql file you should ask the author.
Related posts:




