I want to store the result of a MySQLi query as a session variable so that I can reuse it without executing the query again. I don\'t want to execute the same query on every pag
Use like this:
$result = $connection->query("select something from table"); $_SESSION['session-name'] = $result->fetch_assoc();
OR
$sql = `select something from table`; $result = mysqli_query($sql); $_SESSION['session name'] = mysqli_fetch_assoc($result);