title: pass parameters to mysql_connect function from a different file
body: <p>I have two php files called <code>dbcon.php</code> and <code>user.php</code>. 
  This is my <code>user.php</code> file</p>
  
  <pre><code>&lt;?php
  /* variable needed for the user to connect to the database */
  $host = "localhost"; //your database host name
  $dbuser = "root"; //your database user name
  $dbpassword = "123"; //your database password
  $dbase = "mysitedb"; //your database
  ?&gt;
  </code></pre>
  
  <p>This is my <code>dbcon.php</code> file</p>
  
  <pre><code>&lt;?php
  $con = mysql_connect($host,$dbuser,'wecarealways');
  if (!$con)
    {
    die('Could not connect: ' . mysql_error());
    }
  
  $db_selected = mysql_select_db($dbase, $con);
  
  if (!$db_selected)
    {
    die ("Can\'t use test_db : " . mysql_error());
    }
   else {
        echo 'successful';
  }
  
  mysql_close($con);
  
  ?&gt;
  </code></pre>
  
  <p>I need to connect to the database called <code>mysitedb</code> bot it does not get connected. I think problem is with the separate <code>user.php</code> file. I need to know how to give parameters to <code>mysql_connect()</code> in this case.
  thanks!</p>