I'm creating my own Framework basic and I just need to go through a%%% query and I've been paused in the SELECT
and confirm that the query arrives with its% function get_query
parameter but when walking the WHILE is where I mark the error I want to do it with the "SELECT * FROM status WHERE id_status=1"
function.
A little help please.
//metodo privado para conectarse a bd
private function db_open(){
$this->conn = new mysqli(self::$db_Host,self::$db_root,self::$db_pass,$this->db_name);
$this->conn->set_charset(self::$db_charset);
}
private function db_close(){
$this->conn->close();
}
//establecer un query simple que afecte datos de tipo insert , delete , update
protected function set_query(){
$this->db_open();
//metodo query heredado de mysqli
$this->conn->query($this->query);
$this->db_close();
}
//obtener resultados de una consulta tipo select en un array
protected function get_query(){
$this->db_open();
echo $this->query;
$result = $this->conn->query($this->query);
var_dump($result);
while( $this->registro = $result->fetch_array(MYSQLI_ASSOC) );
var_dump($this->registro);
//cerrar consulta de result
$result->close();
//cerrams conexion con base de datos
$this->db_close();
//quita el ultimo elemento del arreglo arraypop
return ($this->registro);
}
}