本文整理汇总了PHP中SaeMysql类的典型用法代码示例。如果您正苦于以下问题:PHP SaeMysql类的具体用法?PHP SaeMysql怎么用?PHP SaeMysql使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SaeMysql类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: syncPhone
function syncPhone($id, $oldPhone, $newPhone)
{
$url = 'http://x.suzhoumaker.com/syncAction.php';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "oldPhone=" . $oldPhone . "&newPhone=" . $newPhone);
// receive server response ...
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$server_output = curl_exec($ch);
curl_close($ch);
$syncAction = 3;
// further processing ....
$mysql = new SaeMysql();
if ($server_output == "OK") {
$syncAction = 0;
}
$sql = "UPDATE Member SET m_sync_action = " . $syncAction . ", m_updated_on=now() WHERE m_num=" . $id;
$mysql->runSql($sql);
if ($mysql->errno() != 0) {
die("Error:" . $mysql->errmsg());
} else {
//
}
$mysql->closeDb();
}
开发者ID:kisunsz,项目名称:kisun,代码行数:26,代码来源:utils.php
示例2: TimingTask
function TimingTask()
{
// load urls
$mysql = new SaeMysql();
$sql = "SELECT url FROM `url`";
$data = $mysql->getData( $sql );
$mysql->closeDb();
$queue = new SaeTaskQueue('task_queue_0_2');
$array = array();
for($i = 0; $i < sizeof($data); ++$i)
{
//$array[] = array('url'=>"http://urlwatcher.sinaapp.com/url_watch.php", "postdata"=>"target=".$data[$i], "prior"=>true);
$array[] = array('url'=>"http://urlwatcher.sinaapp.com/url_watch.php?target=" . $data[$i]["url"], "postdata"=>NULL, "prior"=>true);
}
$queue->addTask($array);
$ret = $queue->push();
if ($ret === false)
{
var_dump($queue->errno(), $queue->errmsg());
echo "Failed.";
}
else
{
echo "Success.";
print_r($array);
}
}
开发者ID:0902horn,项目名称:urlwatcher-sae,代码行数:30,代码来源:cron_daily.php
示例3: _getNewAccessToken
/**
* 调用微信接口,重新获取access_token
* @return string
*/
private function _getNewAccessToken()
{
// 获取新的access_token
$apiUrl = sprintf($this->_apiUrl, APP_ID, APP_SECRET);
$newAccessToken = Curl::doCurl($apiUrl);
// 判断是否获取成功
if (!$newAccessToken['errcode'] && !empty($newAccessToken['access_token'])) {
// 将新获取的access_token更新到数据库
$c_time = time() - 200;
// 将获取到的时间提前一点
$mysql = new SaeMysql();
$sql = "SELECT `c_time`, `t_value` FROM `weixin_access_token`";
$data = $mysql->getData($sql);
//$data = DbPDO::table('weixin_access_token')->find();
if (!$data) {
// 首次插入
//DbPDO::table('weixin_access_token')->where(array('id'=>1))->add(array('c_time' => $c_time, 't_value' => $newAccessToken['access_token']));
$sql = "INSERT INTO `weixin_access_token` (`c_time`, `t_value`) VALUES ({$c_time}, " . $newAccessToken['access_token'] . ")";
} else {
// 修改
//DbPDO::table('weixin_access_token')->where(array('id'=>1))->save(array('c_time' => $c_time, 't_value' => $newAccessToken['access_token']));
$sql = "UPDATE `weixin_access_token` SET `c_time` = {$c_time} , `t_value` = " . $newAccessToken['access_token'] . " WHERE id = 1";
}
$mysql->runSql($sql);
$mysql->closeDb();
} else {
throw new Exception($newAccessToken['errcode'] . '-' . $newAccessToken['errmsg']);
}
return $newAccessToken['access_token'];
}
开发者ID:pemako,项目名称:weixin,代码行数:34,代码来源:AccessToken.class.php
示例4: getAstrosData
function getAstrosData()
{
$mysql = new SaeMysql();
$sql0 = "SELECT * FROM `" . tname("astro") . "` LIMIT 12";
$astros = $mysql->getData($sql0);
return $astros;
}
开发者ID:vangogogo,项目名称:justsns,代码行数:7,代码来源:astro_common.php
示例5: index
public function index()
{
$mysql = new SaeMysql();
$sql = "SELECT * FROM `scrawl` WHERE sid = 1";
$data = $mysql->getData($sql);
if ($mysql->errno() != 0) {
die("Error:" . $mysql->errmsg());
}
$this->assign('svg', $data[0]['data']);
$this->display();
}
开发者ID:hansen1416,项目名称:svg-drawing,代码行数:11,代码来源:ScrawlAction.class.php
示例6: db_connect
/**
* Non-persistent database connection
*
* @access private called by the base class
* @return resource
*/
function db_connect()
{
if ($this->port != '') {
$this->hostname .= ':' . $this->port;
}
//---change---//
//return @mysql_connect($this->hostname, $this->username, $this->password, TRUE);
$t_saemysql = new SaeMysql();
$t_saemysql->setCharset($this->char_set);
$t_saemysql->setAuth($this->username, $this->password);
$t_saemysql->setPort($this->port);
return $t_saemysql;
}
开发者ID:ruoyousi,项目名称:MyFunds-sae,代码行数:19,代码来源:mysql_driver.php
示例7: ShowDiff
function ShowDiff($group_id, $from, $to, &$summary)
{
$mysql = new SaeMysql();
$sql = "SELECT url FROM `url` WHERE `group_id`=" . $group_id;
$urls = $mysql->getData( $sql );
$results = array();
for($i = 0; $i < sizeof($urls); ++$i)
{
$title = "";
$content_diff = "";
$sql_from = "SELECT content FROM `web_content` WHERE `url`='" . $urls[$i]['url'] . "' AND `date`='" . $from . "'";
$sql_to = "SELECT content FROM `web_content` WHERE `url`='" . $urls[$i]['url'] . "' AND `date`='" . $to . "'";
$content_from = $mysql->getVar( $sql_from );
$content_to = $mysql->getVar( $sql_to );
if (!$content_from || !$content_to)
{
array_attach($results, foutput('failed', $urls[$i]['url'], NULL, $summary));
}
else
{
if ($content_from !== $content_to)
{
$content_diff = GetFormattedDiff($content_from, $content_to);
if (is_string($content_diff))
{
array_attach($results, foutput('changed', $urls[$i]['url'], $content_diff, $summary));
}
else
{
array_attach($results, foutput('error', $urls[$i]['url'], NULL, $summary));
}
}
else
{
array_attach($results, foutput('identical', $urls[$i]['url'], NULL, $summary));
}
}
}
$mysql->closeDb();
return $results;
}
开发者ID:0902horn,项目名称:urlwatcher-sae,代码行数:48,代码来源:diff.php
示例8: get_book_count
function get_book_count($bookid)
{
if (empty($bookid)) {
return "数量异常";
}
$mysql = new SaeMysql();
$sql = "SELECT count FROM bookinfo WHERE id = '" . $bookid . "'";
$data = $mysql->getData($sql);
if (empty($data[0][0])) {
return "数量异常";
}
//取到总备货数量
$count1 = intval($data[0][0]);
$sql = "SELECT SUM(count) FROM sellinfo WHERE bookid = '" . $bookid . "' GROUP BY null";
$data = $mysql->getData($sql);
$count2 = 0;
if (!empty($data[0][0])) {
$count2 = intval($data[0][0]);
}
return strval($count1 - $count2);
}
开发者ID:a707937337,项目名称:letsgo_work,代码行数:21,代码来源:test.php
示例9: update
public function update(){
$query = "update toupiao set {$this->pingwei} = {$this->score} where keshi_name = '{$this->jiemu}'";
//echo $query;
$mysql = new SaeMysql();
$query_submit = "select didSubmit from score_pingwei where score like '{$this->pingwei}'";
$resultOfQuery_submit = $mysql->getData($query_submit);
//var_dump($this->pingwei);
//var_dump($resultOfQuery_submit);
if ($resultOfQuery_submit[0]["didSubmit"] > 1 || ($this -> score>100)|| ($this -> score<75)) {
# code...
$this->show_error();
}else{
$mysql->runSql( $query );
$mysql->closeDb();
$this->show_success();
}
}
开发者ID:sueflybaby,项目名称:learngit,代码行数:22,代码来源:insert.php
示例10: check_admin
function check_admin()
{
if (isset($_COOKIE["admin_id"]) && isset($_COOKIE["admin_username"]) && isset($_COOKIE["admin_key"])) {
$id = intval($_COOKIE["admin_id"]);
$mysql = new SaeMysql();
$sql = "select * from `qs_admin` where `id`={$id}";
$row = $mysql->getLine($sql);
$mysql->closeDb();
if (3 == count($row)) {
$admin_username = $row["username"];
$admin_key = md5($row["password"] . $admin_username);
if ($_COOKIE["admin_key"] == $admin_key) {
return true;
} else {
return false;
}
} else {
return false;
}
} else {
return false;
}
}
开发者ID:dalinhuang,项目名称:OEMS,代码行数:23,代码来源:common-function.php
示例11: header
<?php
header("content-type:text/html; charset=utf-8");
//require_once('../utility.php');
//require_once('../SaeMysql.php');
$mysql = new SaeMysql();
$sql = "INSERT INTO `WM_Log` (`page`) VALUES('A4-20160522')";
$mysql->runSql($sql);
$mysql->closeDb();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=10, user-scalable=yes">
<title>政策揭秘:美联储加息,你的恐惧为哪般?</title>
<meta name="description" content="Release by WorldMoney 2016.01.01">
<meta name="author" content="WorldMoney">
<link href="../bootstrap/css/bootstrap.min.css" rel="stylesheet">
<!-- link href="../bootstrap/css/style.css" rel="stylesheet" -->
<link rel="stylesheet" href="../bootstrap/weui-master/dist/style/weui.css"/>
<link rel="stylesheet" href="../bootstrap/weui-master/dist/style/weui.min.css"/>
<link rel="stylesheet" href="../bootstrap/fancybox/jquery.fancybox.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../css/zhuanyangqian.css" />
<link rel="stylesheet" href="../css/A5.css" />
开发者ID:initialb,项目名称:UCMS,代码行数:31,代码来源:A4-20160521.php
示例12: header
<?php
header("Content-Type:application/json;charset=UTF-8");
$code = $_GET['code'];
$poc = array("poc_1" => 1, "poc_2" => 2, "poc_3" => 3, "poc_4" => 4, "poc_5" => 5, "poc_6" => 6, "poc_7" => 7, "poc_8" => 8, "poc_9" => 9, "poc_10" => 10);
//参数 code验证
if (strpos($code, "||") == false) {
echo json_encode(array("status" => false, "msg" => "error code!"));
exit;
}
list($key, $value) = explode("||", $code);
if ($value != strtoupper(substr(md5("hongcha" . $key . "android"), 1, -1))) {
echo json_encode(array("status" => false, "msg" => "error code!"));
exit;
}
$mysql = new SaeMysql();
$sql = "select * from result where code ='" . $mysql->escape($code) . "'";
$data = $mysql->getData($sql);
$result = array();
if ($data) {
$tmpdata = $data[0];
foreach ($tmpdata as $key => $value) {
if ($key != "code" && $key != "id" && $key != "token" && $key != "ua") {
$result[$key] = intval($value);
}
}
echo json_encode(array("status" => true, "msg" => $result));
} else {
echo json_encode(array("status" => false, "msg" => "query empty!"));
}
$mysql->closeDb();
开发者ID:crackeer,项目名称:uxss,代码行数:31,代码来源:get.php
示例13: SaeMysql
<h6 align="center"><a href="admin_personal.php">查看评委打分</a> || <a href="admin_dafeng.php">固化打分</a> || <a href="result.php">观众最喜爱结果的评分</a></h6>
<table border='1' align='center'>
<tr>
<th>节目序号</th>
<th>节目名称</th>
<th>表演者</th>
<th>小组</th>
<th>总分</th>
<th>平均分</th>
<th>(去)总分</th>
<th>(去)平均分</th>
</tr>
<?php
//connect database
$mysql = new SaeMysql();
//mysqli_query($mysqli,"SET NAMES utf8");
$query = "select * from toupiao";
$result = $mysql->getData($query);
//var_dump($result);
$array_pingfeng = array();
//创建数组 存储qu平均分后的数组 记录id和平均分
for ($i = 0; $i < count($result); $i++) {
$row = $result[$i];
// var_dump($row);
$num_child_row = count($row) - 5;
$array_score = array_slice($row, 5);
//off 5 argues
sort($array_score);
$total_score = array_sum($array_score);
$total_pingjun_score = $total_score / $num_child_row;
开发者ID:sueflybaby,项目名称:learngit,代码行数:31,代码来源:admin.php
示例14: die
<?php
$title = $_POST['title'];
$abstract = $_POST['abstract'];
$url = $_POST["url"];
$thumbnail = $_POST['thumbnail'];
$type = $_POST["type"];
$status = $_POST["status"];
$reviewer = $_POST["reviewer"];
$deliver = $_POST["deliver"];
$create_at = $_POST["create_at"];
$delete = $_POST["delete"];
if (empty($title)) {
die("{\"s_status\": \"ERROR\",\"s_message\": \"Empty data\",\"s_code\": 0}");
}
$mysql = new SaeMysql();
$sql = "INSERT INTO `android_digest_review`( `title`, `abstract`, `url`, `thumbnail`, `type`, `status`, `reviewer`, `deliver`, `create_at`, `delete`) " . "VALUES ('" . $title . "', '" . $abstract . "', '" . $url . "', '" . $thumbnail . "', '" . $type . "', '" . $status . "', '" . $reviewer . "', '" . $deliver . "', '" . $create_at . "', '" . $delete . "') ";
$mysql->runSql($sql);
if ($mysql->errno() != 0) {
die("{\"s_status\": \"ERROR\",\"s_message\": \"" . $mysql->errmsg() . "\",\"s_code\": 1}");
} else {
die("{\"s_status\": \"OK\",\"s_message\": \"\",\"s_code\": 200}");
}
$mysql->closeDb();
开发者ID:collectionByZcz,项目名称:AndroidDigest,代码行数:23,代码来源:review_post.php
示例15: SaeMysql
<?php
if (defined('SAE_MYSQL_DB')) {
$sql = new SaeMysql();
} else {
require 'x/mysql.class.php';
}
$list = $sql->getData('SELECT * FROM imouto_article ORDER BY created DESC LIMIT 0,15');
$h = '<?xml version="1.0" encoding="UTF-8"?>' . "\n" . '<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">' . "\n" . '<channel>' . "\n" . ' <title>卜卜口</title>' . "\n" . ' <link>http://mouto.org/</link>' . "\n" . ' <description>94年少年。</description>' . "\n" . ' <lastBuildDate>' . date('D, d M Y H:i:s ', $list[0]['created']) . '</lastBuildDate>' . "\n" . ' <language>zh-CN</language>' . "\n";
foreach ($list as $p) {
$h .= ' <item>' . "\n" . ' <title><![CDATA[' . $p['title'] . ']]></title>' . "\n" . ' <link>http://mouto.org/#!' . $p['pid'] . '</link>' . "\n" . ' <category>' . $p['category'] . '</category>' . "\n" . ' <pubDate>' . date('D, d M Y H:i:s ', $p['created']) . '</pubDate>' . "\n" . ' <description><![CDATA[';
if ($p['cover']) {
$h .= '<p><img src="http://ww2.sinaimg.cn/large/' . $p['cover'] . '.jpg"></p>';
}
$h .= $p['text'] . ']]></description>' . "\n" . ' </item>' . "\n";
}
$h .= '</channel>' . "\n" . '</rss>';
header('Content-type: application/rss+xml;charset=utf-8');
exit($h);
file_put_contents('rss.xml', $h);
开发者ID:lonjoy,项目名称:imouto,代码行数:20,代码来源:rss.php
示例16: SaeMysql
<?php
//装载模板文件
include_once "wx_tpl.php";
include_once "base-class.php";
//新建sae数据库类
$mysql = new SaeMysql();
//新建Memcache类
$mc = memcache_init();
//获取微信发送数据
$postStr = $GLOBALS["HTTP_RAW_POST_DATA"];
//每次抽取几题
$question_nums = 20;
//返回回复数据
if (!empty($postStr)) {
//解析数据
$postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);
//发送消息方ID
$fromUsername = $postObj->FromUserName;
//接收消息方ID
$toUsername = $postObj->ToUserName;
//消息类型
$form_MsgType = $postObj->MsgType;
//欢迎消息
if ($form_MsgType == "event") {
//获取事件类型
$form_Event = $postObj->Event;
//订阅事件
if ($form_Event == "subscribe") {
//欢迎词
$welcome_str = "欢迎来到YYF答题系统\n\n\n已添加由\n“NEUQ ACM俱乐部”\n提供的\n《计算机基础》题库。\n===NEUQ ACM===\n每次问答系统将从题库中随机抽取" . $question_nums . "道题目,都为单选题,输入选项对应字母答题。\n\n准备好了吗?输入“go”进行答题:\n(答案已尽量修正,若还有错误,请谅解)";
开发者ID:QPG,项目名称:answer_system,代码行数:31,代码来源:wx_interapi.php
示例17: getAnalysedRepory
private function getAnalysedRepory($reports)
{
$kv = new SaeKV();
$kv->init();
$maxDaysOfMonth = $kv->get('maxDaysOfMonth');
$increaseRate = $kv->get('increaseRate');
$salesTarget = $kv->get('salesTarget');
$manTarget = $kv->get('manTarget');
$cosmeticsTarget = $kv->get('cosmeticsTarget');
$mysql = new SaeMysql();
$month = $reports[0][1];
$day = $reports[0][2];
$sql = "SELECT SUM(`dailySales`) FROM `sales_amount` WHERE `date` = '2016-" . $month . "-" . $day . "'";
$data = $mysql->getData($sql);
$lastYearDailySales = $data[0]['SUM(`dailySales`)'];
$sql = "SELECT SUM(`monthlySales`) FROM `sales_amount` WHERE `date` = '2016-" . $month . "-" . $day . "'";
$data = $mysql->getData($sql);
$lastYearMonthlySales = $data[0]['SUM(`monthlySales`)'];
$dailyTarget = $this->sum($reports, 3);
$realSales = $this->sum($reports, 4);
$totalSales = $this->sum($reports, 6);
$cosmeticsSales = $this->sum($reports, 7);
$manSales = $this->sum($reports, 8);
$line1 = "华东大区," . $month . "月" . $day . "日,时间进度" . round($day / $maxDaysOfMonth * 100) . "%,当月目标增长率" . $increaseRate . "%\r\n";
$line2 = "1)当日指标:" . $dailyTarget . ",实际销量:" . $realSales . ",当日达成率:" . round($realSales / $dailyTarget * 100, 1) . "%,同比增长:" . round(($realSales / $lastYearDailySales - 1) * 100, 1) . "%;\r\n";
$line3 = "2)当月指标:" . $salesTarget . ",累计销售:" . $totalSales . ",累计达成率:" . round($totalSales / $salesTarget * 100, 1) . "%,同比增长:" . round(($totalSales / $lastYearMonthlySales - 1) * 100, 1) . "%;\r\n";
$line4 = "3)重点品:男士销售:" . $manSales . "元,男士指标达成:" . round($manSales / $manTarget * 100, 1) . "%;彩妆销售:" . $cosmeticsSales . "元,彩妆指标达成:" . round($cosmeticsSales / $cosmeticsTarget * 100, 1) . "%;\r\n";
$line5 = "4)执行反馈:无";
return $line1 . $line2 . $line3 . $line4 . $line5;
}
开发者ID:PhilipDing,项目名称:JALAReport,代码行数:30,代码来源:server.php
示例18: saemysql
public function saemysql()
{
$mysql = new SaeMysql();
$mysql->runSql('create table saetest(`id` int(11) NOT NULL);');
echo '在本地时请先配置好数据库,本程序执行完毕后会向数据库中建立名为saetest数据表';
}
开发者ID:dutyu,项目名称:FaceJoin,代码行数:6,代码来源:IndexAction.class.php
示例19: time
<!--插入查询功能-->
<h1 align="center">玉环县人民医院医师信息审核系统</h1>
<h6 align="center">后台控制 版本1.0 制作人:<a href="market_admin_repick.php">苏维杰</a> 制作时间:2015-09-10</h6>
<h1 align="center">医务科后台</h1>
<?php
//creat timestamp for record
$t = time();
$datestamp = date("Y-m-d H:i", $t);
echo "<h6 align='center'>现在时间:" . $datestamp . "</h6>";
//connect database
require_once 'conn.php';
//define openid
//getdata for person
$sql = "SELECT * FROM personalinformation_records WHERE 'check_rsk'='checked' ORDER BY id DESC";
$mysql = new SaeMysql();
//echo the result
echo "<table border='1' align='center' class='datalist'>";
$num = 0;
$query_sql = $mysql->getData($sql);
$numoflist = count($query_sql);
//$get_data =mysql_query("select * from waimai where class='{$class}' ORDER BY ord DESC");//查询
if ($numoflist <= 10) {
//如果总数小于等于10则全部生成
// makeList($get_data);
} else {
//总数大于10则分页
if (!isset($_GET['limit'])) {
$limitHead = 0;
} else {
$limitHead = $_GET['limit'];
开发者ID:sueflybaby,项目名称:learngit,代码行数:31,代码来源:admin_ywk.php
示例20: income
<?php
$amount = $_POST[amount];
$memberId = $_POST[memberId];
//echo $amount." ".$memberId;
$sql1 = "insert into income (amount,time,member_id) values ({$amount},now(),{$memberId})";
$sql2 = "update depot set updatetime = now(), balance = balance+{$amount}";
$sql3 = "update member set updatetime = now(),balance = balance+{$amount} where id = {$memberId}";
$mysql = new SaeMysql();
$mysql->runSql($sql1);
if ($mysql->errno() != 0) {
die("Error:" . $mysql->errmsg());
}
$mysql->runSql($sql2);
if ($mysql->errno() != 0) {
die("Error:" . $mysql->errmsg());
}
$mysql->runSql($sql3);
if ($mysql->errno() != 0) {
die("Error:" . $mysql->errmsg());
}
$mysql->closeDb();
echo "<SCRIPT LANGUAGE='JavaScript'>";
echo "location.href='income.php'";
echo "</SCRIPT>";
开发者ID:AccountingPlatform,项目名称:club4fun,代码行数:25,代码来源:addIncome.php
注:本文中的SaeMysql类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论