class db extends PDO{
function open($modul)
{
return $this->query("select * from `$modul` ORDER by `id` ASC");
}
function open_pr($modul,$time)
{
return $this->query("select * from `$modul` where `time` > '$time' ORDER by `id` ASC");
}
function add($modul,$add)
{
return $this->exec("insert into `$modul` (`name`,`time`,`msg`) values($add)");
}
function edit($modul,$edit,$where='')
{
return $this->exec("update `$modul` set $edit $where");
}
function del($modul,$d)
{
return $this->exec("delete from `$modul` where `id`='$d'");
}
}
$db = new db("mysql:host=$DB_HOST;dbname=$DB_BASE", $DB_USER, $DB_PASS);
$db->query('set charset utf8');
$db->query('SET names utf8');
$db->query('set character_set_client="utf8"');
$db->query('set character_set_connection="utf8"');
$db->query('set character_set_result="utf8"');
class book{
function down()
{
global $db;
$res = $db->open("book");
$_SESSION['book']['time']=date("Y-m-d H:i:s");
header('Content-type: application/json');
die(json_encode($res->fetchAll()));
}
function...
Поиск по сайту
Результаты поиска: «book»
Найдено совпадений: 322
17.04.2014 / 07:46
12.07.2012 / 12:42
17.07.2008 / 00:23
07.02.2010 / 03:29
22.12.2016 / 14:11
24.04.2010 / 09:08
24.04.2010 / 09:25
24.04.2010 / 09:34
04.02.2015 / 21:44
18.01.2017 / 22:10
