|
Directory : /home/zjabogados/public_html/Libs/ |
<?php
//CLASE MGMData
class MGMData {
var $result;
var $cant_rows;
var $row;
function __construct($query) {
//echo "<br><br>$query";
$this->result = mysqli_query($_SESSION['conexion'], $query) or die(mysqli_error($_SESSION['conexion']));
//echo '<br>result: '.$this->result;
if (strtoupper(substr($query, 0, 6)) == 'SELECT') {
$this->cant_rows = mysqli_num_rows($this->result);
}
}
function Next() {
$this->row = mysqli_fetch_array($this->result);
return $this->row;
}
function First() {
if ($this->cant_rows > 0) {
mysqli_data_seek($this->result, 0);
}
}
function Close() {
mysqli_free_result($this->result);
}
function Go($position) {
if ($this->cant_rows > 0) {
mysqli_data_seek($this->result, $position);
}
}
}
?>