Технологии

Не могу понять как выводится print_r($row); в mysqli через php, есть require_once "config_class.php"; - вопрос №1020173

class DataBase {


private $config;
private $mysqli;

public function __construct() {
$this->$this->config = new Config ();
$this->$mysqli = new mysqli ($this->config->db_host, $this->config->db_user, $this->config->db_password, $this->config->db_name);
$this->$mysqli->query(«SET NAMES 'utf8'»);

}

public function select($result_set) {
$result_set = $mysqli->query(«SELECT * FROM `s_tb`»);
if (!$result_set) return false;
return $this->resultSetToArray($result_set);
}

private function resultSetToArray($result_set) {
$array = array();
while (($row = $result_set->fetch_assoc()) !=false) {
$array[] = $row;
print_r($row);
}
$array = array();
}

public function __destruct() {
if ($this->mysqli) $this->mysqli->close();
}


}

?>

апрель 9, 2014 г.

  • Всего ответов: 1

  • Leo - аватарка

    Leo

    25-й в

    приватным методом resultSetToArray(), который вызывается из публичного метода select().

    март 8, 2016 г.

Похожие вопросы

Аккорд WinNET

декабрь 16, 2012 г.

Технологии