I have three consecutive php files, One that shows results from a database fetch query, One that inserts data into the database and One that updates data. The first php file goes to the second and the second goes to the third. They all share the same database connection and database. In the first one I write $db = Database::getInstance(); $mysqli = $db->getConnection();
Should I close the database connection with mysqli_close($mysqli);
on every file??? I think it should be closed on the third file only. Let me know.