Не могу понять как выводится 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();
}


}

?>

09.04.14
1 ответ

Ответы

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

Виталий

Читать ответы

Alexander

Читать ответы

Дима

Читать ответы
Посмотреть всех экспертов из раздела Технологии > PHP
Пользуйтесь нашим приложением Доступно на Google Play Загрузите в App Store