How to implement php interface
<p>When I visit </p>

<p><code>http://localhost/oopphp5/Chapter2/interfacetest.php</code></p>

<p>the following give an error and I would like to know why.</p>

<p>error</p>

<blockquote>
  <p>Fatal error: Class 'MySQLDriver' not found in
      /Users/teacher/Sites/oopphp5/Chapter2/interfacetest.php on line 6</p>
</blockquote>

<p>interface.dbdriver.php</p>

<pre><code>interface DBDriver
{
 public function connect();
 public function execute($sql);
}
</code></pre>

<p>class.mysqldriver.php</p>

<pre><code>require_once("interface.dbdriver.php"); 

class MySQLDriver implements DBDriver 
{
public function connect()
 {
   //connect to database
   echo "connected";
 }
 public function execute($query)
 {
   //execute the query and output result
   echo "executed";
 }
} 
</code></pre>

<p>interfacetest.php</p>

<pre><code>require_once("class.mysqldriver.php");
$mysql = new MySQLDriver();
</code></pre>

<p>Thanks in advance.</p>

<p>Updated: changed to <code>require_once</code> but it still displays an error.</p>
