I use at the beginning of the page:
session_start(); if(!isset($_SESSION['db'])) $_SESSION['db'] = mysqli_connect('localhost', 'user', 'password', 'mydb'); $db = $_SESSION['db']; Further on page work with requests goes normally. I run a script through ajax, in which at the top of the page:
session_start(); $db = (object) $_SESSION['db']; And then the work with the requests does not go, errors in the requests, as if there is no disconnection, what is the error?