当前位置: 首页>>代码示例>>PHP>>正文


PHP mysql_class::ex_sqlx方法代码示例

本文整理汇总了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);
         }
     }
 }
开发者ID:hscomp2002,项目名称:superp,代码行数:27,代码来源:shahr_class.php

示例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}')");
 }
开发者ID:hscomp2002,项目名称:superp,代码行数:10,代码来源:sms_class.php

示例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}");
    }
}
开发者ID:hscomp2002,项目名称:superp,代码行数:12,代码来源:access_det.habibi.php

示例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;
 }
开发者ID:hscomp2002,项目名称:superp,代码行数:13,代码来源:session_class.php

示例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}'");
}
开发者ID:hscomp2002,项目名称:superp,代码行数:13,代码来源:sanad_gozaresh.php

示例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;
}
开发者ID:hscomp2002,项目名称:superp,代码行数:7,代码来源:parvaz_forookhte.php

示例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);
}
开发者ID:hscomp2002,项目名称:superp,代码行数:25,代码来源:admin.habibi.php

示例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;
 }
开发者ID:hscomp2002,项目名称:superp,代码行数:27,代码来源:cache_class.php

示例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}'");
    }
}
开发者ID:hscomp2002,项目名称:superp,代码行数:7,代码来源:customers.habibi.php

示例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);
}
开发者ID:hscomp2002,项目名称:superp,代码行数:26,代码来源:group.php

示例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);
 }
开发者ID:hscomp2002,项目名称:superp,代码行数:7,代码来源:pardakht_class.php

示例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);
    }
}
开发者ID:hscomp2002,项目名称:superp,代码行数:8,代码来源:setjid.php

示例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}");
    }
}
开发者ID:hscomp2002,项目名称:superp,代码行数:8,代码来源:parvaz.hamed.php

示例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");
    */
}
开发者ID:hscomp2002,项目名称:superp,代码行数:18,代码来源:clearTicket.php

示例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}') ");
        }
    }
}
开发者ID:hscomp2002,项目名称:superp,代码行数:9,代码来源:changeAccess.habibi.php


注:本文中的mysql_class::ex_sqlx方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。