• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP mysql_class类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中mysql_class的典型用法代码示例。如果您正苦于以下问题:PHP mysql_class类的具体用法?PHP mysql_class怎么用?PHP mysql_class使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了mysql_class类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: load_tickets

function load_tickets($user, $pass, $sanad_record_ids)
{
    $tmp_arr = array();
    $my = new mysql_class();
    $u = new user_class();
    $u->loadByUser($user);
    $customer_id = $u->customer_id;
    $my->ex_sql("select * from ticket where customer_id={$customer_id} and  sanad_record_id in ({$sanad_record_ids})", $q);
    foreach ($q as $r) {
        $tick = new ticket_class();
        //$tick->id = (int)$r['id'];
        unset($tick->sanad_record_id);
        $tick->fname = $r["fname"];
        $tick->lname = $r["lname"];
        $tick->tel = $r["tel"];
        $tick->adult = (int) $r["adult"];
        $tick->rahgiri = (int) $r["sanad_record_id"];
        $tick->parvaz_det_id = (int) $r["parvaz_det_id"];
        $tick->customer_id = (int) $r["customer_id"];
        $tick->user_id = (int) $r["user_id"];
        $tick->shomare = (int) $r["shomare"];
        $tick->typ = (int) $r["typ"];
        $tick->en = (int) $r["en"];
        $tick->regtime = $r["regtime"];
        $tick->mablagh = (int) $r["mablagh"];
        $tick->tour_mablagh = (int) $r["tour_mablagh"];
        $tick->poorsant = (int) $r["poorsant"];
        $tick->gender = (int) $r["gender"];
        $tmp_arr[] = $tick;
    }
    $out = xml_class::export($tmp_arr);
    return $out;
}
开发者ID:hscomp2002,项目名称:superp,代码行数:33,代码来源:load_tickets.php


示例2: 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


示例3: 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


示例4: 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


示例5: get

 public static function get($source_id)
 {
     $out = 0;
     $my = new mysql_class();
     $my->ex_sql("select rookeshi from rookeshi where source_id={$source_id}", $q);
     if (isset($q[0])) {
         $out = (int) $q[0]['rookeshi'];
     }
     return $out;
 }
开发者ID:jnaroogheh,项目名称:darvishi,代码行数:10,代码来源:rookeshi_class.php


示例6: epass

function epass($cid)
{
    $mysql = new mysql_class();
    $out = "";
    $mysql->ex_sql("select `epass` from `customers` where `id`='{$cid}'", $q);
    if (isset($q[0])) {
        $out = $q[0]["epass"];
    }
    return $out;
}
开发者ID:hscomp2002,项目名称:superp,代码行数:10,代码来源:back_checkflight.php


示例7: loadByParvaz_det_id

 public function loadByParvaz_det_id($parvaz_det_id)
 {
     $my = new mysql_class();
     $out = -1;
     $my->ex_sql("select sites_id from parvaz_det_sites where parvaz_det_id={$parvaz_det_id}", $qp);
     foreach ($qp as $r) {
         $out = $r['sites_id'];
     }
     return $out;
 }
开发者ID:hscomp2002,项目名称:superp,代码行数:10,代码来源:sites_class.php


示例8: 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


示例9: __construct

 public function __construct($moghim_code = -1)
 {
     $mysql = new mysql_class();
     $mysql->ex_sql("select * from `agency` where `moghim_code` = '{$moghim_code}'", $q);
     if (count($q) > 0) {
         foreach ($q[0] as $fi => $val) {
             $this->{$fi} = $val;
         }
     }
 }
开发者ID:hscomp2002,项目名称:superp,代码行数:10,代码来源:agency_class.php


示例10: loadCustomerName

function loadCustomerName()
{
    $mysql = new mysql_class();
    $out = null;
    $mysql->ex_sql('select `name`,`id` from `customers` order by `name`', $q);
    foreach ($q as $r) {
        $out[$r['id']] = (int) $r['name'];
    }
    return $out;
}
开发者ID:hscomp2002,项目名称:superp,代码行数:10,代码来源:manifest.php


示例11: sanadJam

function sanadJam($where = '')
{
    $out = array("sum_mablagh" => 0);
    $mysql = new mysql_class();
    $mysql->ex_sql("select sum(`mablagh`) as `sm` from `customer_daryaft` " . ($where != '' ? " where {$where}" : ''), $q);
    if (isset($q[0])) {
        $out = array("sum_mablagh" => (int) $q[0]['sm']);
    }
    return $out;
}
开发者ID:hscomp2002,项目名称:superp,代码行数:10,代码来源:sales_admin_sanad.php


示例12: loadUser

function loadUser($inp)
{
    $out = '';
    $mysql = new mysql_class();
    $mysql->ex_sql("select `fname`,`lname` from `user` where `id`='{$inp}'", $q);
    if (isset($q[0])) {
        $out = $q[0]['fname'] . ' ' . $q[0]['lname'];
    }
    return $out;
}
开发者ID:hscomp2002,项目名称:superp,代码行数:10,代码来源:setpoorsant.php


示例13: dabel

function dabel($user, $enc_pass, $id)
{
    $id = (int) $id;
    $out = "auth_error";
    if (user_class::is_authonticated($enc_pass, $user)) {
        $my = new mysql_class();
        $my->ex_sql("select jid from parvaz_jid where parvaz_det_id = {$id}", $q);
        $out = xml_class::export($q);
    }
    return $out;
}
开发者ID:hscomp2002,项目名称:superp,代码行数:11,代码来源:dabel.php


示例14: sherkat

function sherkat($user, $pass)
{
    $tmp_arr = array();
    $my = new mysql_class();
    $my->ex_sql("select * from sherkat order by name", $q);
    foreach ($q as $r) {
        $tmp_arr[] = array('id' => $r['id'], 'name' => $r['name']);
    }
    $out = xml_class::export($tmp_arr);
    return $out;
}
开发者ID:hscomp2002,项目名称:superp,代码行数:11,代码来源:sherkat.php


示例15: city

function city($user, $pass)
{
    $out = 'auth_error';
    if (user_class::is_authonticated($pass, $user)) {
        $tmp_arr = array();
        $my = new mysql_class();
        $my->ex_sql("select * from shahr order by name", $q);
        $out = xml_class::export($q);
    }
    return $out;
}
开发者ID:hscomp2002,项目名称:superp,代码行数:11,代码来源:city.php


示例16: __construct

 public function __construct($id = -1)
 {
     $mysql = new mysql_class();
     $mysql->ex_sql("select * from `grop` where `id` = {$id}", $q);
     if (isset($q[0])) {
         $r = $q[0];
         $this->id = $r['id'];
         $this->name = $r['name'];
         $this->en = $r['en'];
     }
 }
开发者ID:hscomp2002,项目名称:superp,代码行数:11,代码来源:grop_class.php


示例17: delete_item

function delete_item($table, $id, $gname)
{
    $id = (int) $id;
    $c = new customer_class($id);
    $mysql = new mysql_class();
    $out = FALSE;
    if (!$c->protected) {
        $out = $mysql->ex_sqlx("update `{$table}` set `en` = '0' where `id` = '{$id}'") == "ok";
    }
    return $out;
}
开发者ID:hscomp2002,项目名称:superp,代码行数:11,代码来源:customers.php


示例18: getLastSanad_record_id

 public function getLastSanad_record_id()
 {
     $mysql = new mysql_class();
     $sanad_record_id = 200;
     $mysql->ex_sql("select max(`sanad_record_id`) as `sss` from `customer_daryaft`", $q);
     if (isset($q[0])) {
         $sanad_record_id = (int) $q[0]["sss"] > 199 ? (int) $q[0]["sss"] : 199;
         $sanad_record_id++;
     }
     return $sanad_record_id;
 }
开发者ID:hscomp2002,项目名称:superp,代码行数:11,代码来源:sanad_class.php


示例19: loadSherkatName

function loadSherkatName($inp)
{
    $mysql = new mysql_class();
    $inp = (int) $inp;
    $out = "";
    $mysql->ex_sql("select `name` from `sherkat` where `id` = '{$inp}'", $q);
    if (isset($q[0])) {
        $out = $q[0]["name"];
    }
    return $out;
}
开发者ID:hscomp2002,项目名称:superp,代码行数:11,代码来源:checkflight.php


示例20: loadAll

 public static function loadAll($iata = '')
 {
     $iata = strtoupper(trim($iata));
     $out = "";
     $my = new mysql_class();
     $my->ex_sql("select iata,name,en_name from city where iata <> '' order by id", $q);
     foreach ($q as $r) {
         $out .= "<option value='" . $r['iata'] . "'" . ($iata == $r['iata'] ? ' selected' : '') . ">" . $r['name'] . '/' . $r['en_name'] . '/' . $r['iata'] . "</option>";
     }
     return $out;
 }
开发者ID:jnaroogheh,项目名称:darvishi,代码行数:11,代码来源:city_class.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP mysql_squid_builder类代码示例发布时间:2022-05-23
下一篇:
PHP mysqlConnection类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap