Undefined Variable Where Variable is assigned a value
<p>My Errors Are:</p>

<blockquote>
  <p>Notice: Undefined variable: sql in C:\xampp\htdocs\framework\frame.php on line 20</p>
</blockquote>

<p>Notice: Undefined variable: sql in C:\xampp\htdocs\framework\frame.php on line 20</p>

<p>Notice: Undefined variable: sql in C:\xampp\htdocs\framework\frame.php on line 20</p>

<p>Notice: Undefined variable: sql in C:\xampp\htdocs\framework\frame.php on line 20</p>

<p>Notice: Undefined variable: dbC in C:\xampp\htdocs\login.php on line 17</p>

<p>Fatal error: Call to a member function query() on null in C:\xampp\htdocs\login.php on line 17</p>

<p>I have a file that includes another (PHP)</p>

<p>config.php:</p>

<pre><code>$sql_host = "localhost";
$sql_user = "root";
$sql_pass = "";
$sql_databasename = "data";
</code></pre>

<p>Simple, right?</p>

<p>Now to frame.php:</p>

<pre><code>    require($_SERVER['DOCUMENT_ROOT'] . "/inc/config.php");
$sql = array(
        "host" =&gt; $sql_host,
        "user" =&gt; $sql_user,
        "pass" =&gt; $sql_pass,
        "dbid" =&gt; $sql_databasename,
    );

    foreach ($sql as $v){
        if (!isset($v)){
            die("ERROR: SQL LOGIN INVALID");
        }
    }

    function connectSQL(){
        $dbC = new mysqli($sql["host"], $sql["user"], $sql["pass"], $sql["dbid"]);

        if ($dbC-&gt;connect_error){
            die("SQL Error: " . $dbC-&gt;connection_error);
        }
    }
</code></pre>

<p>And I don't understand why this is happening? Any ideas?</p>