本文整理汇总了PHP中SaeMysql::errmsg方法的典型用法代码示例。如果您正苦于以下问题:PHP SaeMysql::errmsg方法的具体用法?PHP SaeMysql::errmsg怎么用?PHP SaeMysql::errmsg使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SaeMysql
的用法示例。
在下文中一共展示了SaeMysql::errmsg方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: mysqlc
function mysqlc($content)
{
$mysql = new SaeMysql();
if ($content == 'help') {
$data = 'Select' . "\n" . 'Insert' . "\n" . 'Update' . "\n" . 'Delete' . "\n" . 'Create' . "\n" . 'Drop' . "\n" . 'Index' . "\n" . 'Alter';
} else {
if (preg_match('#^(select)#i', $content)) {
$sqlresult = $mysql->getData($content);
if ($mysql->errno() != 0) {
$data = "Error:" . $mysql->errmsg();
} else {
$data = 'mysql> ' . $content . "\n" . '-----------------' . "\n";
foreach ($sqlresult as $row) {
foreach ($row as $key => $value) {
$data .= $key . ':' . $value . "\n";
}
$data .= '------------------' . "\n";
}
}
} else {
$mysql->runSql($content);
if ($mysql->errno() != 0) {
$data = "Error:" . $mysql->errmsg();
}
}
}
return $data;
}
示例2: 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();
}
示例3: 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();
}
示例4: intval
$class_name = string::un_script_code($class_name);
$class_fid = intval($class_fid);
//默认参数
$nowtime = date("Y/m/d H:i:s", time());
//如果是修改
if ($old_class_id) {
//修改部门名称、所属、更新时间
$sql = "update class set class_name='{$class_name}',class_fid='{$class_fid}',edittime='{$nowtime}'\n where class_id={$old_class_id}";
$mysql->runSql($sql);
} else {
//新增
$sql = "insert into class (class_name,class_fid,addtime,edittime,status) values ('{$class_name}',\n '{$class_fid}','{$nowtime}','{$nowtime}',1)";
$mysql->runSql($sql);
}
if ($mysql->errno() != 0) {
echo "<script>alert('" . $mysql->errmsg() . "');history.back();</Script>";
exit;
} else {
echo "<script>alert('操作成功!');location='class_add.php?class_id={$old_class_id}';</Script>";
exit;
}
}
$class_list = $mysql->getData("select class_name,class_id from class where status=1 order by class_fid asc");
?>
<!--页面名称-->
<h3>部门添加/修改<a href="class_manager.php">返回>></a></h3>
<!--表单开始-->
<form action="?" method="post" name="class_add" id="class_add" enctype="multipart/form-data">
<p>
部门名称:<input type="text" value="<?php
echo $class_value["class_name"];
示例5: die
echo "<h1>警告</h1>";
echo "<h3>版本" . $_SERVER['HTTP_APPVERSION'] . "已完成安装!请删除/install/目录!</h3>";
echo "<h3>如果重新安装请先删除storage内的 saestor_" . $_SERVER['HTTP_APPVERSION'] . "/data/install.lock 文件</h3>";
} else {
// 判断是否已经初始化了storage,mc,mysql
if (is_storage() && is_mc() && is_mysql()) {
$fp = @fopen(dirname(__FILE__) . "/ecshop4sae.sql", "r") or die("不能打开SQL文件 {$file_name}");
//打开文件
if ($fp) {
$mysql = new SaeMysql();
echo "正在执行导入操作:";
while ($SQL = GetNextSQL()) {
$SQL = str_replace("`ecs_", "`" . TABLE_PREFIX, $SQL);
// echo $SQL."<BR/>";
if (!$mysql->runSql($SQL)) {
echo "执行出错:" . $mysql->errmsg() . "";
echo "SQL语句为:" . $SQL . "";
exit;
}
}
echo "导入完成<br/>";
echo "<h1>安装成功</h1>";
echo "点击<a href='/admin'>/admin</a> 进入后台,管理员帐号为admin 密码为123<br/><br/><h2>注意</h2>为确保安全请登入后台后修改密码!并使用svn删除/install目录!";
@fclose($fp);
$s = new SaeStorage();
$s->write(SAESTOR_NAME, "saestor_" . $_SERVER['HTTP_APPVERSION'] . "/data/install.lock", '1');
} else {
echo "<h1>错误</h1>";
echo "ecshop4sae.sql文件不存在!";
}
} else {
示例6: 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();
示例7: 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>";
示例8: runquery
<?php
$lvyi_db = new SaeMysql();
//install
$sql = file_get_contents('./db.sql');
//do
runquery($sql);
//report
if ($lvyi_db->errno() != 0) {
die("Error:" . $lvyi_db->errmsg());
}
$lvyi_db->closeDb();
//include success template
function runquery($sql)
{
global $lvyi_db;
$sql = str_replace("\r", "\n", $sql);
$ret = array();
$num = 0;
foreach (explode(";\n", trim($sql)) as $query) {
$queries = explode("\n", trim($query));
foreach ($queries as $query) {
$ret[$num] .= $query[0] == '#' || $query[0] . $query[1] == '--' ? '' : $query;
}
$num++;
}
unset($sql);
$strtip = "";
foreach ($ret as $query) {
$query = trim($query);
if ($query) {
示例9: use
$name = "";
sae_log("名字不存在" . $name);
}
$mysql->closeDb();
return Message::make('news')->items(function () use($name, $welcome) {
return $welcome($name);
});
}
});
//取消关注
$server->on('event', 'unsubscribe', function ($event) {
sae_log("用户取消关注: " . $event->openid);
$mysql = new SaeMysql();
$signup = "update wechat_user set isFollow = 0, unfollowTime = '" . date("Y/m/d-H:i:s") . "'WHERE\n openid='{$event->FromUserName}'";
$mysql->runSql($signup);
sae_log($mysql->errno() . "-" . $mysql->errmsg());
$mysql->closeDb();
});
//文字消息处理,调用图灵机器人
$server->on('message', 'text', function ($message) use($welcome) {
//四六级查分-备份考号
return handleText($message->Content, $message->FromUserName, $welcome);
});
//图片处理,调用微软API
$server->on('message', 'image', function ($image) {
$picUrl = $image->PicUrl;
$face = new Face($picUrl);
$info = $face->info;
if ($info !== false) {
$amount = count($info);
$description = "";
示例10: python
$mysql->runSql("UPDATE python SET state=0 WHERE FromUserName='{$openid}'");
$data = '已退出Python终端...';
} else {
$data = python($content);
}
} elseif ($result[0]['state'] == 2) {
if ($content == 'quit') {
$mysql->runSql("UPDATE python SET state=0 WHERE FromUserName='{$openid}'");
$data = '已退出Mysql终端...';
} elseif ($content == 'help') {
$data = 'Select' . "\n" . 'Insert' . "\n" . 'Update' . "\n" . 'Delete' . "\n" . 'Create' . "\n" . 'Drop' . "\n" . 'Index' . "\n" . 'Alter';
} else {
if (preg_match('#^(select)#i', $content)) {
$sqlresult = $mysql->getData($content);
if ($mysql->errno() != 0) {
$data = "Error:" . $mysql->errmsg();
} else {
$data = 'mysql> ' . $content . "\n" . '-----------------' . "\n";
foreach ($sqlresult as $row) {
foreach ($row as $key => $value) {
$data .= $key . ':' . $value . "\n";
}
$data .= '------------------' . "\n";
}
}
} else {
$mysql->runSql($content);
if ($mysql->errno() != 0) {
$data = "Error:" . $mysql->errmsg();
}
}
示例11: VALUES
$examid = $mysql->getVar($examid);
//数据库保存的openid
$openid_db = $query['openid'];
$name = $query['name'];
$_SESSION['examid'] = $examid;
$_SESSION['name'] = $name;
//var_dump($examid);
//var_dump($mysql->getLine($query));
//var_dump($mysql->getVar($query));
//sae_log(json_encode($openid . "-" . $examid));
//用户尚未注册
if (empty($openid_db)) {
$signup = "INSERT INTO wechat_user (openid) VALUES ('{$openid}') ";
$bool = $mysql->runSql($signup);
if (!$bool) {
echo $debug = sprintf("注册失败 %d : %s", $mysql->errno(), $mysql->errmsg());
sae_log($debug);
} else {
// echo "你已成功注册" . "<br/>";
// echo "即将跳转到备份的页面";
// echo "if 111111";
//跳到填写考号和姓名的页面
header("Location:http://5.n1gel.sinaapp.com/cet_query.php");
//填写之后,更新session,更新数据库
}
//用户已注册,为备份考号和姓名
} elseif (empty($examid)) {
// echo "即将跳转到备份的页面";
// echo "if 222222222";
header("Location:http://5.n1gel.sinaapp.com/cet_query.php");
//页面获取exanid和姓名直接查询,将查询结果存到数据库并显示到页面,生成一个模板图片,让用户保存
示例12: getAstroMonthSql
include 'astro_common.php';
$astros = getAstrosData();
$mysql = new SaeMysql();
$day = date('Ymd', strtotime("+1 day"));
if (!empty($astros)) {
foreach ($astros as $one) {
$astro_name = strtolower($one['astro_name_en']);
$tmp = getAstroMonth($astro_name);
$tmp['astro_id'] = $one['astro_id'];
$data[] = $tmp;
$sql = getAstroMonthSql($tmp);
$mysql->runSql($sql);
}
if ($mysql->errno() != 0) {
print_r("Error:" . $mysql->errmsg());
}
}
$mysql->closeDb();
function getAstroMonthSql($params)
{
$sql = 'replace ' . tname("astro_month") . '(';
foreach ($params as $attribute => $value) {
$sql .= "`" . $attribute . "`,";
}
$sql .= ') values (';
foreach ($params as $attribute => $value) {
$value = trim($value);
$sql .= "'" . $value . "',";
}
$sql .= ');';
示例13: DBinsert
function DBinsert($userid, $username)
{
$mysql = new SaeMysql();
$sql_1 = "SELECT * FROM `users` WHERE `weiboid` =" . $userid;
//$sql_1 = "SELECT * FROM `users` LIMIT 10";
$data = $mysql->getData($sql_1);
if ($mysql->errno() != 0) {
die("Error_1:" . $mysql->errmsg());
}
if (count($data) == 0) {
$sql_2 = "INSERT INTO `users` ( `weiboid` , `weiboname` ) VALUES ('" . $userid . "','" . $username . "') ";
$mysql->runSql($sql_2);
} else {
foreach ($data as $v1) {
echo '<p/>';
echo 'weiboname: ' . $v1['weiboname'] . '<br/>';
}
}
$sql_3 = "SELECT `pynames` FROM `users` WHERE `weiboid` =" . $userid;
$data = $mysql->getData($sql_3);
if ($mysql->errno() != 0) {
die("Error_3:" . $mysql->errmsg());
}
if (checkArray($data)) {
echo 'pyname is null <br/>';
} else {
//echo "length of data=".count($data).'<br/>';
foreach ($data as $v1) {
//echo '<p/>';
//echo 'pynames: ' . $v1['pynames'] . '<br/>';
$ps = explode(",", $v1['pynames']);
//echo "length of ps=".count($ps).'<br/>';
foreach ($ps as $v2) {
//echo '<p/>';
//echo 'pynames: ' . $v2 . '<br/>';
$sql_4 = "SELECT `pynames` FROM `users` WHERE `weiboid` =" . $v2;
$data_4 = $mysql->getData($sql_4);
if ($mysql->errno() != 0) {
die("Error_4:" . $mysql->errmsg());
}
if (count($data_4) == 0) {
echo '<p/>';
echo 'pynames: ' . $v2 . ' 还没有使用本服务<br/>';
} else {
echo 'pynames: ' . $v2 . ' 选中的有:';
foreach ($data_4 as $v3) {
//echo '<p/>';
echo $v3['pynames'] . '<br/>';
if (strpos($v3['pynames'], (string) $userid, 0) === false) {
//echo '没有找到';
} else {
echo '用户' . $v2 . '也选择了您!';
}
}
}
}
//SelectTag($ps);
}
}
$mysql->closeDb();
}
示例14: upuserlock
function upuserlock($lock, $username)
{
$mysql = new SaeMysql();
$sql = "UPDATE `wx_users` SET `lock` = '{$lock}' WHERE `openid` = '{$username}'";
$mysql->runSql($sql);
if ($mysql->errno() != 0) {
die("Error:" . $mysql->errmsg());
}
$mysql->closeDb();
}
示例15: SaeMysql
</script>
<?php
} else {
$is_name = true;
}
if ($is_examid && $is_name) {
$_SESSION['examid'] = $examid;
$_SESSION['name'] = $name;
//更新数据库
$mysql = new SaeMysql();
$update = "insert into cet (examid,name,openid) VALUES ('{$examid}','{$name}','{$openid}')";
$updata_wx = "update wechat_user set name='{$name}' WHERE openid='{$openid}'";
$bool = $mysql->runSql($update);
$bool = $mysql->runSql($updata_wx);
if (!$bool) {
sae_log("插入考号姓名出错" . $mysql->errmsg());
}
$mysql->closeDb();
//跳转
header("Location:http://5.n1gel.sinaapp.com/cet_result.php");
}
}
//endregion
?>
<!doctype>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,user-scalable=no,initial-scale=1"/>
<link rel="stylesheet" href="http://cdn.rmbz.net/bootstrap-3.3.5-dist/css/bootstrap.min.css">
<title>四六级查分</title>