1、插入数据
$db->query("INSERT INTO ".get_table($mid)." ($sqlk) VALUES ($sqlv)");
$itemid = $db->insert_id();
2、获取一条数据
$r = $db->get_one("SELECT COUNT(*) AS num FROM {$table} WHERE $condition order by statid desc");
if($r['num']>0){
exit('{"status":"0","msg":"重复"}');
}else{
}
函数在include/db_mysql.class.php 中定义
function query($sql, $type = '', $ttl = 0, $save_id = false) {
#echo $sql;echo '
';
$select = strtoupper(substr($sql, 0, 7)) == 'SELECT ' ? 1 : 0;
if($this->ttl > 0 && $type == 'CACHE' && $select) {
$this->cursor = 0;
$this->cache_id = md5($sql);
if($this->cids) $this->cache_ids[