本文整理汇总了PHP中disconnect函数的典型用法代码示例。如果您正苦于以下问题:PHP disconnect函数的具体用法?PHP disconnect怎么用?PHP disconnect使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了disconnect函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionScrollview
public function actionScrollview($text = "")
{
if ($text == "") {
$query = "SELECT article_modulecomponentid FROM scrolltext WHERE page_modulecomponentid=" . $this->moduleComponentId;
$result = mysql_query($query);
$row = mysql_fetch_assoc($result);
$articleid = $row['article_modulecomponentid'];
$query = "SELECT article_content,article_lastupdated FROM article_content WHERE page_modulecomponentid=" . $articleid;
$result = mysql_query($query);
if ($row = mysql_fetch_assoc($result)) {
$text = $row['article_content'];
global $PAGELASTUPDATED;
$PAGELASTUPDATED = $row['article_lastupdated'];
} else {
return "Article not yet created.";
}
}
$content = "<HEAD><META HTTP-EQUIV=REFRESH CONTENT=300></HEAD><body><div><div align=\"center\"><fieldset><marquee behavior=scroll scrollAmount=\"1\" scrolldelay=\"0\" onmouseover=\"this.stop()\" direction=\"up\" onmouseout=\"this.start()\" vspce=\"800px\"style=\"height:800px;width:800px;font-size:15px;color:#880000;\">" . $text . "</div></fieldset></marquee></body>";
global $sourceFolder;
global $moduleFolder;
require_once $sourceFolder . "/pngRender.class.php";
if (get_magic_quotes_gpc()) {
$content = stripslashes($content);
}
$render = new pngrender();
echo $render->transform($content);
disconnect();
exit;
}
示例2: fetchAllorders
function fetchAllorders()
{
$con = connect();
$result = mysqli_query($con, "SELECT * from orders");
disconnect($con);
return $result;
}
示例3: error
function error($msg)
{
global $title, $header;
html($title, $header, "<h2>Erro</h2>{$msg}");
disconnect();
exit(1);
}
示例4: fetchWithQuery
function fetchWithQuery($query)
{
$con = connect();
$result = mysqli_query($con, $query);
disconnect($con);
return $result;
}
示例5: testConnect
public function testConnect()
{
global $connection_string;
$this->assertTrue(isset($connection_string), "connection string should be set");
$dbconnection = connect();
$this->assertTrue(isset($dbconnection), "DB Connection should be set");
disconnect($dbconnection);
}
示例6: numberOfRespondents
/** Prints the number of people that have responded to the poll */
function numberOfRespondents()
{
connect();
$q = "SELECT * FROM " . RESULTS_TABLE;
$result = mysql_query($q) or mysql_err($q);
print mysql_num_rows($result);
disconnect();
}
示例7: reg
public function reg()
{
$state = $this->in_get('state', None, 2, 'True');
$wx_data = base64_decode($state);
$code = $this->in_get('code', None, 2, 'True');
$wx_data_arr = explode('@@', $wx_data);
$schId = intval($wx_data_arr[0]);
$room = in($wx_data_arr[1]);
$phone = in($wx_data_arr[2]);
$msg = Check::rule(array(check::mobile($phone), '手机电话号码格式不对'));
if ($msg != 1) {
$this->alert('您的手机号码不正确');
}
$r = connectRedis($this->config['RD_HOST'], $this->config['RD_PORT'], $this->config['RD_PWD']);
$apiUser = new api_userMod();
$wx_res = $apiUser->get_info_user_weixin($code, $r);
if (!$wx_res) {
$this->alert('请用微信登陆');
}
$check_con['openid'] = $wx_res['openid'];
$field = 'p_id';
$check_res = $this->model->table($this->config['info_person'])->field($field)->where($check_con)->find();
if ($check_res) {
// 如果此微信号已经存在,直接登陆
$apiUser->set_login_mark($check_res['p_id'], $code, $r);
disconnect($r);
$this->redirect(__ROOT__ . '/order/water');
} else {
// 否则插入数据
$data['s_id'] = $schId;
$res = $this->model->table($this->config['school'])->where($data)->find();
if ($res) {
$data['name'] = $wx_res['nickname'];
$data['addr'] = $room;
$data['phone'] = $phone;
$data['openid'] = $wx_res['openid'];
$data['pic'] = $wx_res['headimgurl'];
$data['s_name'] = $res['name'];
$data['sex'] = $wx_res['sex'];
$data['city'] = $wx_res['city'];
$data['province'] = $wx_res['province'];
$data['point'] = 100;
$res = $this->model->table($this->config['info_person'])->data($data)->insert();
if ($res) {
$apiUser->set_login_mark($res, $code, $r);
disconnect($r);
setcookie('susCode', time(), time() + EX_TIME_COOKIE, __ROOT__);
$this->redirect(__URL__ . '/suss');
} else {
disconnect($r);
$this->alert('对不起,网络暂时出了点小问题');
}
} else {
disconnect($r);
$this->alert('对不起,贵校暂时没有开通此服务');
}
}
}
示例8: get_notes
function get_notes($user_id)
{
$mysql_link = connect();
$query = sprintf("SELECT * FROM note WHERE user_id='%s'", mysql_real_escape_string($user_id, $mysql_link));
$result = mysql_query($query, $mysql_link);
$notes = fetch_all($result);
disconnect($mysql_link);
return $notes;
}
示例9: execute_update
function execute_update($sql)
{
$db = connect();
$res = mysql_query($sql, $db);
if (!$res) {
trigger_error("Error executing update :" . mysql_error());
die;
}
disconnect($db);
}
示例10: execute_update
function execute_update($sql)
{
$db = connect();
$res = pg_query($db, $sql);
if (!$res) {
trigger_error("Error executing update :" . pg_last_error($res));
die;
}
disconnect($db);
}
示例11: execute_insert
function execute_insert($email, $pass, $FirstName, $LastName)
{
$con = connect();
$sql = " INSERT INTO info (\n\t\t\t\t\t\t\t\t`Email`,\n\t\t\t\t\t\t\t\t`Pass`,\n\t\t\t\t\t\t\t\t`First`,\n\t\t\t\t\t\t\t\t`Last`)\n\t\t\t\t\t\tVALUES(\n\t\t\t\t\t\t\t\t'" . $email . "',\n\t\t\t\t\t\t\t\t'" . md5($pass) . "',\n\t\t\t\t\t\t\t\t'" . $FirstName . "',\n\t\t\t\t\t\t\t\t'" . $LastName . "'\n\t\t\t\t\t\t\t\t)";
if (!mysql_query($sql, $con)) {
header("location:form.php?err=Email is already in used");
} else {
disconnect($con);
return true;
}
}
示例12: Remove_SQLi
function Remove_SQLi($str)
{
$con = connect();
if (get_magic_quotes_gpc()) {
$retStr = mysql_real_escape_string(stripslashes($str));
} else {
$retStr = mysql_real_escape_string($str);
}
disconnect($con);
return $retStr;
}
示例13: connect
function connect()
{
// Connects to mySQL database
if ($GLOBALS['db']['connected']) {
disconnect();
}
$GLOBALS['db']['conn'] = new mysqli($GLOBALS['db']['server'], $GLOBALS['db']['user'], $GLOBALS['db']['pass'], $GLOBALS['db']['database']);
if ($GLOBALS['db']['conn']->connect_error) {
die("Connection failed: " . $GLOBALS['db']['conn']->connect_error);
}
$GLOBALS['db']['connected'] = true;
}
示例14: executeQueryId
function executeQueryId($query)
{
$this->connect();
$this->query = $query;
if ($this->result = mysql_query($this->query)) {
return $this->result;
} else {
echo "Ocorreu um erro na execu��o da SQL<BR>";
echo "Erro :" . mysql_error() . "<BR>";
echo "SQL: " . $query . "<BR>";
die;
disconnect();
}
}
示例15: executeQuery
function executeQuery($query)
{
$this->connect();
$this->query = $query;
if ($this->result = mysql_query($this->query)) {
$this->disconnect();
return $this->result;
} else {
echo "<b>Ocorreu um erro</b><br>";
echo "Erro: " . mysql_error();
die;
disconnect();
}
}