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


PHP mysql_class类代码示例

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


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


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