dbconnect function error
<p>Somewhere within my dbconnect function it is not close in the right spot. I have been over and over it and I still can't find it. 
here is my dbconnect function:</p>

<pre><code>    function dbConnect(){
     // Connect to the database:
     $hostname="localhost";
     $database="tblFile";
     $mysql_login="valerie2_shuawna";
     $mysql_password="norris";

     if(!($db=mysql_connect($hostname, $mysql_login, $mysql_password))){
        echo"error on connect";
     }
     else{
        if(!(mysql_select_db($database,$db))){
            echo mysql_error();
            echo "&lt;br /&gt;error on database connection. Check your settings.";
        }
        else{
                    echo "I have successfully made a connection to my database and everything
     is working as it should.";
   }
}
</code></pre>

<p>then here is another part that has the dbconnect():</p>

<pre><code>dbConnect();
    $SQL="SELECT fileID FROM tblFile WHERE fileName='".$result."'";
    //echo $SQL;
    $rs=mysql_query($SQL);
    echo mysql_num_rows($rs);
    if(mysql_num_rows($rs)!=0){
        $extension=strrchr($result,'.');
        $result=str_replace($extension,time(),$result);
        $result=$result.$extension;
    }
    return $result;
}
</code></pre>

<p>I cant not find where it is not seeing where it should be closed at.</p>
