myaac/system/libs/data.php
slawkens1 7b23ffaf23 update to 0.1.5
fixed bug with "Integrity constraint violation: 1048 Column 'ip' cannot
be null"
2017-05-13 22:43:14 +02:00

46 lines
744 B
PHP

<?php
/**
* Data class
*
* @package MyAAC
* @author Slawkens <slawkens@gmail.com>
* @copyright 2017 MyAAC
* @version 0.1.5
* @link http://my-aac.org
*/
defined('MYAAC') or die('Direct access not allowed!');
class Data
{
private $table = '';
public function __construct($table) {
$this->table = $table;
}
public function get($where)
{
global $db;
return $db->select($this->table, $where);
}
public function add($data)
{
global $db;
return $db->insert($this->table, $data);
}
public function delete($data, $where)
{
global $db;
return $db->delete($this->table, $data, $where);
}
public function update($data, $where)
{
global $db;
return $db->update($this->table, $data, $where);
}
}
?>