Hi,
I have an SQL file that I am trying to run and create the tables in my database but at the moment I can not get it to work. Most likley its something that needs to be changed in my code. Can you take a look at the code and tell me what I have wrong please.
<?php
//Get the required files.
$sql = include 'test.sql';
//Run the sql file to create the tables.
mysql_connect ("localhost", "user", "pass") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("database");
$query = mysql_query($sql);
if (!$query) {
echo 'Could not run query: ' . mysql_error();
exit;
}
?>