title: Source a MySQL file through PHP?
body: <p>how do I source a .sql file, like the one below, through php?</p>
  
  <pre><code>CREATE DATABASE IF NOT EXISTS data_base;
  USE data_base;
  CREATE TABLE IF NOT EXISTS the_table( 
      package_name varchar(50) NOT NULL,
      PRIMARY KEY (`package_name`)
  )
  </code></pre>
  
  <p>I tried the following, but it doesn't work. I've tried to do some research and it seems I need to do something called LOAD DATA INFILE, but I don't understand it.</p>
  
  <pre><code>mysql_query("source C:/xampp/htdocs/Project1/mysql/source.sql;") or die(mysql_error());
  </code></pre>
  
  <p>How can I source an .sql file using PHP? Thanks.</p>