If you have installed phpMyAdmin do as below.
Go to localhost/phpmyadmin/server_sql.php.
Paste the SQL Code in the text box shown in the page and press GO button at the bottom right of the page.
Go to localhost/phpmyadmin/server_sql.php.
Paste the SQL Code in the text box shown in the page and press GO button at the bottom right of the page.
If you want to run code in PHP file do as below.
Open your PHP file.
Add these lines in the file.
mysql_query("sql code here");
NOTE – Replace the red line with the SQL code.