MySQL Log-In with PHP - How often? <p>Okay this might be an obvious question, but as soon as i call MySQL with PHP (whhich means i log in) and then close the PHP tag, (shown below) Do I have to call the database again later?</p> <pre><code>$mysqli = new mysqli("host", "username", "pw", "dbname"); if ($mysqli-&gt;connect_errno) { echo "Failed to connect to MySQL: (" . $mysqli-&gt;connect_errno . ") " . $mysqli-&gt;connect_error; } $res = $mysqli-&gt;query("SELECT EmbedURL FROM Videos ORDER BY RAND() LIMIT 8"); </code></pre> <p>etc... And then I need to call it again later in the script to fetch something else fromt he database. Do i have to log into the database again?</p> <p>Thank you!</p>