public static function getIconByName($name) { $sql = "select icon from emotion where value='" . $name . "'"; $mysql = new MySQL(); $res = $mysql->executeReturnFirstObj($sql); $mysql->closeCon(); return $res; }
public static function getPage($pageid) { $sql = "select a.id,a.pageid,a.title,a.viewnum,a.cover,a.imgnum,a.disnum,a.praisenum,a.status,a.cuserid,a.cusername,\n a.cdate,a.udate ,b.img\n from page a left join page_img b\n on a.pageid=b.pageid where a.pageid=" . $pageid; $mysql = new MySQL(); $res = $mysql->executeReturnObj($sql); $mysql->closeCon(); return $res; }
public static function insertDiscuss($disObj) { $mysql = new MySQL(); $res = $mysql->insert("page_discs", $disObj); $mysql->closeCon(); PageService::updateDisNum($disObj['pageid']); return $res; }
public static function getUser($user) { $mysql = new MySQL(); $where = " (email='" . $user['user'] . "' or tel='" . $user['user'] . "') and password='******'password'] . "'"; $fd = array("userid,username,email,tel"); $res = $mysql->selectOne("user", $where, $fd); $mysql->closeCon(); return $res; }
public static function getSequence($seqType) { $replace_sql = "replace into sequence(seqname) VALUES('" . $seqType . "')"; $mysql = new MySQL(); $mysql->execute($replace_sql); $get_sql = "select seq from sequence where seqname='" . $seqType . "'"; $res = $mysql->executeReturnFirstObj($get_sql); $seq = $res['seq']; $mysql->closeCon(); return $seq; }
header("Content-type: text/html; charset=utf-8"); session_start(); set_time_limit(0); require_once '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'includes' . DIRECTORY_SEPARATOR . 'Config.php'; require_once dirname(dirname(dirname(__FILE__))) . PATH . "includes" . PATH . 'dao' . PATH . 'MySQL.php'; $data = $_POST['dd']; if (!empty($data)) { $mysql = new MySQL(); $objs = json_decode($data); // echo count($objs);exit; foreach ($objs as $d) { $insertData['phrase'] = $d->phrase; $insertData['type'] = $d->type; $insertData['url'] = $d->url; $insertData['hot'] = $d->hot; $insertData['common'] = $d->common; $insertData['category'] = $d->category; $insertData['icon'] = $d->icon; $insertData['value'] = $d->value; $insertData['picid'] = $d->picid; // var_dump($insertData); $id = $mysql->insert("emotion", $insertData); echo "id=" . $id . " "; } $mysql->closeCon(); echo json_encode("解析成功"); exit; } else { echo json_encode("没有数据"); }
public static function updateShowIndex($pageid, $showIndex) { $nt = time() * 1000; $sql = "update page set showindex=" . $showIndex . ",udate=" . $nt . " where pageid=" . $pageid; $mysql = new MySQL(); $mysql->execute($sql); $mysql->closeCon(); return true; }