title: load config.php with in a class
body: <p>I want to load a configuration file in a class.  Here is the content of config.php</p>
  
  <pre><code>&lt;?php
  $__error_reporting_level=1;
  $server='localhost';
  $user='root';
  $password='';
  $dbase='eauction';
  ?&gt;
  </code></pre>
  
  <p>Content of sql.php</p>
  
  <pre><code>&lt;?php
  include ('config.php');
  error_reporting($__error_reporting_level);
  
  class sql
  {
   function connect()
   {
    $connections = mysql_connect($server, $user,$password) or die ('Unabale to connect to the database');
    mysql_select_db($dbase) or die ('Unable to select database!');
    return;
   }
  
   function login($email, $pwd)
   {
    $this-&gt;connect();
    $result = $this-&gt;qry("SELECT uid,nameF FROM user WHERE email='".$email."' AND password='".$pwd."'");
    $row=mysql_fetch_array($result);
    if (mysql_num_rows($result)&gt;0)
     return array($row[0],$row[1]);
    else
     return array(0,0);
   }
  }
  ?&gt;
  </code></pre>
  
  <p>I execute the code using</p>
  
  <pre><code>include ('core/sql.php');
  $obj = new sql;
  $data=$obj-&gt;login($email,$pwd);
  print_r($data);
  </code></pre>
  
  <p>I get this error </p>
  
  <p><strong>Unable to select database!</strong></p>
  
  <p><em>Ignore mysql injection issue, I just need to execute the code perfectly</em></p>