本文整理汇总了PHP中mysql_class::ex_sqlx方法的典型用法代码示例。如果您正苦于以下问题:PHP mysql_class::ex_sqlx方法的具体用法?PHP mysql_class::ex_sqlx怎么用?PHP mysql_class::ex_sqlx使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mysql_class
的用法示例。
在下文中一共展示了mysql_class::ex_sqlx方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: loadByName
public function loadByName($name)
{
if (trim($name) != '') {
$name = trim($name);
$mysql = new mysql_class();
$ln1 = $mysql->ex_sqlx("insert into shahr_tmp (name) values ('{$name}') ", FALSE);
$tmp_id = $mysql->insert_id($ln1);
$mysql->close($ln1);
$mysql->ex_sql("select name from shahr_tmp where id = {$tmp_id}", $q1);
if (isset($q1[0])) {
$name = $q1[0]['name'];
}
$mysql->ex_sqlx("delete from shahr_tmp where id = {$tmp_id}");
$mysql->ex_sql("select * from shahr where name='{$name}'", $q);
if (isset($q[0])) {
$r = $q[0];
$this->id = $q[0]['id'];
$this->name = $q[0]["name"];
$this->en_name = $q[0]["en_name"];
} else {
$ln = $mysql->ex_sqlx("insert into shahr (name) values ('{$name}') ", FALSE);
$this->id = $mysql->insert_id($ln);
$this->name = $name;
$mysql->close($ln);
}
}
}
示例2: decreaseSms
public function decreaseSms($number, $user_id, $sanad_record_id, $status)
{
$mysql = new mysql_class();
$mysql->ex_sql("select `id` from `sms_charge` where `cont`<`maxi` order by `id` limit 1 ", $q);
if ($isset($q[0])) {
$mysql->ex_sqlx('update `sms_charge` set `cont`=`cont`+1 where `id`=' . $r['id']);
}
//---------------------------------------------------------
$mysql->ex_sqlx("insert into `sms` (`number`,`user_id`,`sanad_record_id`,`sent`) values ('{$number}','{$user_id}','{$sanad_record_id}','{$status}')");
}
示例3: edit_item
function edit_item($id, $feild, $value)
{
if ($feild == 'frase') {
$mysql = new mysql_class();
$mysql->ex_sql("select `id` from `access_det` where `acc_id` = (select `acc_id` from `access_det` where `id`={$id}) and `frase` = '{$value}'", $q);
if (!isset($q[0])) {
$mysql->ex_sqlx("update `access_det` set `frase` = '{$value}' where `id`={$id}");
}
} else {
$mysql->ex_sqlx("update `access_det` set `{$feild}` = '{$value}' where `id`={$id}");
}
}
示例4: write
function write($id, $data)
{
$out = TRUE;
$msql = new mysql_class();
$msql->enableCache = FALSE;
$msql->ex_sql("select `id` from `session` where `id` = '{$id}'", $q);
if (isset($q[0])) {
$msql->ex_sqlx("update `session` set `lastUpdate` = '" . date("Y-m-d H:i:s") . "',`data`='{$data}' where `id` = '{$id}'");
} else {
$msql->ex_sqlx("insert into `session` (`id`,`name`, `data`, `firstTime`, `lastUpdate`) values ('{$id}','" . $this->sessionName . "','{$data}','" . date("Y-m-d H:i:s") . "','" . date("Y-m-d H:i:s") . "')");
}
return $out;
}
示例5: delete_item
function delete_item($id)
{
$mysql = new mysql_class();
$amount = 0;
$customer_id = -1;
$mysql->ex_sql("select `mablagh`,`customer_id` from `customer_daryaft` where `id` = '{$id}'", $q);
if (isset($q[0])) {
$amount = (int) $q[0]["mablagh"];
$customer_id = (int) $q[0]["customer_id"];
}
$mysql->ex_sqlx("delete from `customer_daryaft` where `id` = '{$id}'");
$mysql->ex_sqlx("update `customers` set `max_amount`=`max_amount`-{$amount} where `id` = '{$customer_id}'");
}
示例6: delete_item
function delete_item($table, $inp, $gname)
{
$my = new mysql_class();
$my->ex_sqlx("update `{$table}` set `tarikh` = now() - interval (`timeout` + 1) minute where `id` in ({$inp})");
ticket_class::clearTickets();
return TRUE;
}
示例7: addItem
function addItem()
{
$fields = null;
foreach ($_REQUEST as $key => $value) {
if (substr($key, 0, 4) == "new_") {
if ($key != "new_id" && $key != 'new_tarikh') {
$fields[substr($key, 4)] = $value;
}
}
}
$fields['app'] = conf::app;
$fields['content'] = "<span style=\\'color:#000000;background-color:#4DFF29\\'>" . $fields['content'] . "</span>";
$fi = "(";
$valu = "(";
foreach ($fields as $field => $value) {
$fi .= "`{$field}`,";
$valu .= "'{$value}',";
}
$fi = substr($fi, 0, -1);
$valu = substr($valu, 0, -1);
$fi .= ")";
$valu .= ")";
$query = "insert into `admin` {$fi} values {$valu}";
mysql_class::ex_sqlx($query);
}
示例8: add
public function add($tableName, $data, $query)
{
if ($tableName != '') {
$createTime = date("Y-m-d H:i:s");
$mysql = new mysql_class();
$thisId = -1;
$mysql->enableCache = FALSE;
$mysql->directQuery("select `id` from `cache` where `tableName` = '{$tableName}' and `query` = '{$query}' ", $q);
if ($r = $mysql->fetch_array($q)) {
$thisId = $r['id'];
}
if ($thisId > 0) {
$mysql->directQueryx("update `cache` set `data` = '" . serialize($data) . "' where `id` = '{$thisId}'");
} else {
$ln = $mysql->ex_sqlx("insert into `cache` (`tableName`,`data`,`createTime`,`query`) values('{$tableName}','" . serialize($data) . "','{$createTime}','{$query}') ", FALSE);
$thisId = (int) $mysql->insert_id($ln);
$mysql->close($ln);
}
$this->id = $thisId;
$this->tableName = $tableName;
$this->data = $data;
$this->query = $query;
$this->createTime = $createTime;
$this->viewCount = 1;
}
return $this->id;
}
示例9: delete_item
function delete_item($id)
{
$c = new customer_class($id);
if (!$c->protected) {
mysql_class::ex_sqlx("update `customers` set `en` = '0' where `id` = '{$id}'");
}
}
示例10: add_item
function add_item()
{
$fields = null;
$mysql = new mysql_class();
foreach ($_REQUEST as $key => $value) {
if (substr($key, 0, 4) == "new_") {
if ($key != "new_id" && $key != "new_en") {
$fields[substr($key, 4)] = $value;
}
}
}
$query = '';
$fi = "(";
$valu = "(";
foreach ($fields as $field => $value) {
$fi .= "`{$field}`,";
$valu .= "'{$value}',";
}
$fi = substr($fi, 0, -1);
$valu = substr($valu, 0, -1);
$fi .= ")";
$valu .= ")";
$query = "insert into `grop` {$fi} values {$valu}";
echo $query;
$mysql->ex_sqlx($query);
}
示例11: update
public function update($sanad_record_id)
{
$sanad_record_id = (int) $sanad_record_id;
$sql = "update `pardakht` set `bank_out` = '" . $this->bank_out . "',`sanad_record_id` = '{$sanad_record_id}',`is_tmp` = 0 where `id` = " . $this->id;
$mysql = new mysql_class();
$mysql->ex_sqlx($sql);
}
示例12: edit_item
function edit_item($id, $field, $value)
{
$parvaz_det_id = $GLOBALS['parvaz_det_id'];
mysql_class::ex_sql('select `id` from `parvaz_jid` where `parvaz_det_id` = ' . $parvaz_det_id . ' and `jid` = ' . $value, $q);
if (!($r = mysql_fetch_array($q))) {
mysql_class::ex_sqlx('update `parvaz_jid` set `jid` = ' . $value . ' where `id` = ' . $id);
}
}
示例13: edit_item
function edit_item($id, $feild, $value)
{
if ($feild != "rang") {
mysql_class::ex_sqlx("update `parvaz` set `{$feild}` = '{$value}' where `id` = {$id}");
} else {
mysql_class::ex_sqlx("update `parvaz` set `{$feild}` = '#{$value}' where `id` = {$id}");
}
}
示例14: clearTicket
function clearTicket()
{
$mysql = new mysql_class();
$tarikh = date("Y-m-d H:i:s");
$mysql->ex_sqlx("update `parvaz_det` set `zarfiat`=`zarfiat`+(select SUM(`zarfiat`) from `reserve_tmp` where `parvaz_det_id` = `parvaz_det`.`id` and `tarikh` <= SUBDATE('{$tarikh}' , interval `timeout` minute)) where `id` in (select `parvaz_det_id` from `reserve_tmp` where (not(`tedad` is null)) and `tarikh` <= SUBDATE('{$tarikh}' , interval `timeout` minute))");
$mysql->ex_sqlx("update `customer_parvaz` set `zakhire`=`zakhire`+(select SUM(`zakhire`) from `reserve_tmp` where `customer_id` = `customer_parvaz`.`customer_id` and `tarikh` <= SUBDATE('{$tarikh}' , interval `timeout` minute)) where `parvaz_det_id` in (select `parvaz_det_id` from `reserve_tmp` where `tarikh` <= SUBDATE('{$tarikh}' , interval `timeout` minute)) and `customer_id` in (select `customer_id` from `reserve_tmp` where `tarikh` <= SUBDATE('{$tarikh}' , interval `timeout` minute))");
$mysql->ex_sqlx("delete from `reserve_tmp` where `tarikh` <= SUBDATE('{$tarikh}' , interval `timeout` minute)");
//----------------------پﺍک کﺭﺪﻧ ﻅﺮﻓیﺕ ﻢﻬﻠﺗ ﺩﺍﺭ--
$mysql->ex_sqlx("update `customer_parvaz` set `zakhire` = 0 , regtime = '0000-00-00 00:00:00' WHERE `regtime` + interval `deadtime` minute < '{$tarikh}' and `deadtime` > 0");
/*
//-----------------------پاک کردن بلیط موقت -----
mysql_class::ex_sqlx("update `parvaz_det` set `zarfiat`=`zarfiat`+(select SUM(`zarfiat`) from `reserve_tmp` where `parvaz_det_id` = `parvaz_det`.`id` and `tarikh` <= now() - interval `timeout` minute) where `id` in (select `parvaz_det_id` from `reserve_tmp` where (not(`tedad` is null)) and `tarikh` <= now() - interval `timeout` minute)");
mysql_class::ex_sqlx("update `customer_parvaz` set `zakhire`=`zakhire`+(select SUM(`zakhire`) from `reserve_tmp` where `customer_id` = `customer_parvaz`.`customer_id` and `tarikh` <= now() - interval `timeout` minute) where `parvaz_det_id` in (select `parvaz_det_id` from `reserve_tmp` where `tarikh` <= now() - interval `timeout` minute) and `customer_id` in (select `customer_id` from `reserve_tmp` where `tarikh` <= now() - interval `timeout` minute)");
mysql_class::ex_sqlx("delete from `reserve_tmp` where `tarikh` <= now() - interval `timeout` minute");
//----------------------پاک کردن ظرفیت مهلت دار--
mysql_class::ex_sqlx("update `customer_parvaz` set `zakhire` = 0 , regtime = '0000-00-00 00:00:00' WHERE `regtime` + interval `deadtime` minute < now() and `deadtime` > 0");
*/
}
示例15: setDetByAcc
function setDetByAcc($grp_id, $page_name, $frase)
{
mysql_class::ex_sql("select `id` from `access` where `page_name`='{$page_name}' and `group_id`='{$grp_id}' ", $q);
if ($r = mysql_fetch_array($q)) {
if ($r['id'] > 0) {
mysql_class::ex_sqlx("insert into `access_det` (`acc_id`,`frase`) values('" . $r['id'] . "','{$frase}') ");
}
}
}