sql >> Base de Datos >  >> RDS >> Mysql

PHP variable indefinida conexión mysqli

Problema de alcance variable. Mire global

function includehomepage() {
   global $db;
   $data = array();
   $query = "SELECT pagecontent FROM `pages` WHERE `id` = '0'";
   $query = mysqli_query($db, $query);
   $data = mysqli_fetch_assoc($query);
   return $data['pagecontent'];
}