Ok, there are many ways you can do it, but I'll elaborate the script I made you.
PHP:
$conn = mysql_connect("localhost","username","password");
That line is used to connect to your database server. The first argument (localhost in this example) is the IP or URI address of the server. The second is the username, and third password. The function is stored into $conn variable so we could use it more easily later.
PHP:
mysql_select_db("database",$conn);
That function is used to select a database to which queries will be sent. First agument is name of the databse. The second argument (in this case $conn) is mysql connection link identifier (connection to server).
PHP:
mysql_query(file_get_contents("query.sql"));
This line consists of 2 function. file_get_contents is used to read contents of a file and store it in a string. The first argument in it (and only in this case) is the path to your file. To make it easier you should put your .sql file in same directory as this script. Also make sure that SQL synthax in your sql file is correct and valid.
mysql_query function is used to send a query to database which has been selected by functions in 2 lines above. It's argument is query string, and in this case the string is fetched from your sql file via file_get_contents.
There isn't that much to make it more "steppy" so just make sure that you enter correct details where needed and it will work as intended
