Script Standard within loop
<p>Below I have some code and an error. So first I'll explain what my code does. During the install process of my script one of the things it does is it pulls the SQL files and runs them through and into the database before writing the configuration file. The code below works, but it gives the Strict Standards Error multiple times which then breaks my result from creating the configuration file and in turn the js scripts are broken since they just give the errors. I'm not sure how to go about fixing this with my current script and have and figured someone may look at this and realize that it's something they've seen before and it's actually an easy fix.</p>

<pre><code>Strict Standards: mysqli::next_result(): There is no next result set. Please, call 
mysqli_more_results()/mysqli::more_results() 
</code></pre>

<p>Code:</p>

<pre><code>function TestConnection($host, $user, $pass, $data) {
        $link = mysqli_connect($host, $user, $pass, $data);
        if (!$link) {
            echo "Error: Unable to connect to MySQL." . PHP_EOL;
            echo "Debugging errno: " . mysqli_connect_errno() . PHP_EOL;
            echo "Debugging error: " . mysqli_connect_error() . PHP_EOL;
            exit;
        }
        foreach(glob(root_p."/install/SQL/create/*.sql") as $sqlfile) {
            $command = file_get_contents($sqlfile);
            $link-&gt;multi_query($command);
            while ($link-&gt;next_result()) {
                ;
            } //flush
            $link-&gt;query($command);
        }
        CreateConfig($host, $user, $pass, $data);
        mysqli_close($link);
    }
</code></pre>