當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。