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


PHP mysql::i方法代码示例

本文整理汇总了PHP中mysql::i方法的典型用法代码示例。如果您正苦于以下问题:PHP mysql::i方法的具体用法?PHP mysql::i怎么用?PHP mysql::i使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在mysql的用法示例。


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

示例1: getLostBagLocation

 private function getLostBagLocation($tag = '')
 {
     if (!empty($tag)) {
         $sql = "SELECT * FROM log_check_lost_bag_inbox_notified LEFT JOIN airports USING (iata) WHERE tag_no = '{$tag}' AND contact_details = '{$this->phone_number}' \n";
     } else {
         $sql = "SELECT * FROM log_check_lost_bag_inbox_notified LEFT JOIN airports USING (iata) WHERE contact_details = '{$this->phone_number}' \n";
     }
     $q = mysql::i()->query($sql);
     if (mysql::i()->num_rows($q) == 0) {
         return;
     } elseif (mysql::i()->num_rows($q) == 1) {
         $array[] = mysql::i()->fetch_array($q);
         return $array;
     } else {
         while ($r = mysql::i()->fetch_array($q)) {
             if ($r['country'] == 'USA') {
                 continue;
             }
             if ($tag) {
                 $array[] = $r;
             } else {
                 $array[] = $r;
             }
         }
         return $array;
     }
 }
开发者ID:Git-Host,项目名称:sms,代码行数:27,代码来源:report.class.php

示例2: cancelTag

 private function cancelTag($tag)
 {
     echo $sql = "UPDATE tag_registered r left join customer c on r.customer_id=c.customer_id SET is_deleted=1 WHERE r.tag_no='{$tag}' AND telephone='{$this->phone_number}' \n";
     $q = mysql::i()->query($sql);
     if (mysql::i()->affected_rows($q) == 0) {
         $this->errors[$tag] = "Tag ({$tag}) was not cancelled. Please check and try again or call " . config::get('lost_bag_number');
         return false;
     } else {
         return true;
     }
 }
开发者ID:Git-Host,项目名称:sms,代码行数:11,代码来源:cancel.class.php

示例3: api

 public function api()
 {
     //unfinished
     echo $sql = "SELECT clientMessageReference FROM log_outbound_sms WHERE received=false AND status='LIVE'  \n";
     //and clientMessageReference = 191
     $q = mysql::i()->query($sql);
     while ($r = mysql::i()->fetch_array($q)) {
         $class = utils::recursiveCall('getSMSStatus', $r, 1);
         //$class->
         sleep(1);
         //unset($class);
     }
 }
开发者ID:Git-Host,项目名称:sms,代码行数:13,代码来源:smsstatus.class.php

示例4: define

//print "<pre>";
if (!defined("PATH_SEPARATOR")) {
    if (strpos($_ENV["OS"], "Win") !== false) {
        define("PATH_SEPARATOR", ";");
    } else {
        define("PATH_SEPARATOR", ":");
    }
}
set_include_path('classes/log' . PATH_SEPARATOR . 'classes/api/textanywhere' . PATH_SEPARATOR . 'classes/api' . PATH_SEPARATOR . 'classes/parsers' . PATH_SEPARATOR . 'classes/textanywhere' . PATH_SEPARATOR . 'classes/database' . PATH_SEPARATOR . 'classes/library' . PATH_SEPARATOR . 'classes/exceptions' . PATH_SEPARATOR . 'classes/extract' . PATH_SEPARATOR . 'classes/datadictionary' . PATH_SEPARATOR . 'classes' . PATH_SEPARATOR);
function __autoload($class)
{
    if ($fh = @fopen("{$class}.inc.php", 'r', true)) {
        fclose($fh);
        require "{$class}.inc.php";
    } else {
        require "{$class}.class.php";
    }
}
try {
    config::setup();
    mysql::i(config::get('mysql_conn'));
} catch (dbException $e) {
    debug::output($e->getMessage());
    // any errors in this block then should probably exit
    exit;
} catch (Exception $e) {
    debug::output($e->getMessage());
    // any errors in this block then should probably exit
    exit;
}
开发者ID:Git-Host,项目名称:sms,代码行数:30,代码来源:init.inc.php

示例5: getValidTags

 private function getValidTags()
 {
     debug::output("Get tags against phone number {$this->phone_number}...");
     echo $sql = "SELECT * FROM log_recognised_tags t left join group_tags g on t.tag_no = g.tag  WHERE phone_number = '{$this->phone_number}' AND activated=false \n";
     $q = mysql::i()->query($sql);
     if (mysql::i()->num_rows($q) == 0) {
         return false;
     } else {
         while ($r = mysql::i()->fetch_array($q)) {
             $this->tags[$r['tag_no']] = $r;
         }
         return true;
     }
 }
开发者ID:Git-Host,项目名称:sms,代码行数:14,代码来源:activate.class.php

示例6: checkTagValidityDatabase

 protected function checkTagValidityDatabase($tag)
 {
     $q = parent::checkTagValidityGroup($tag);
     if ($q != false) {
         $r = mysql::i()->fetch_array($q);
         $this->tags[$tag] = $r;
         $this->cost = parent::getTagCost($r['tag_type']);
         $this->type = trim(strtoupper($r['tag_type']));
         return true;
     }
 }
开发者ID:Git-Host,项目名称:sms,代码行数:11,代码来源:renew.class.php

示例7: unLogValidTags

 public function unLogValidTags($tag)
 {
     $sql = "UPDATE log_recognised_tags SET activated=true  WHERE tag_no = '{$tag}'  \n";
     mysql::i()->query($sql);
 }
开发者ID:Git-Host,项目名称:sms,代码行数:5,代码来源:log_database.class.php

示例8: checkTagAlreadyLogged

 private function checkTagAlreadyLogged($tag)
 {
     $sql = "SELECT * FROM log_recognised_tags WHERE tag_no='{$tag}' \n";
     $q = mysql::i()->query($sql);
     if (mysql::i()->num_rows($q) > 0) {
         $r = mysql::i()->fetch_array($q);
         if ($r['phone_number'] == $this->phone_number) {
             //tag is pending activation and belongs to this mobile number. No need to create confusion. Better to validate and continue as if it's the first time it's been registered.
             return true;
         } else {
             $this->errors[$tag] = 'Tag ' . $tag . ' is pending activation against another mobile number. Please check and try again or call ' . config::get('customer_services');
             return false;
         }
     } else {
         //not previously registered according to this log
         return true;
     }
     return false;
 }
开发者ID:Git-Host,项目名称:sms,代码行数:19,代码来源:register.class.php

示例9: release

 public function release()
 {
     mysql::i()->query("delete from script_locks_sms where process_name = '{$this->process_name}' ");
 }
开发者ID:Git-Host,项目名称:sms,代码行数:4,代码来源:scriptLock.class.php

示例10: get_message_avail_num

 private function get_message_avail_num($params)
 {
     $uid = $params['uid'];
     $sql = "select * from little_account where uid={$uid}";
     $row = mysql::i()->get_one($sql);
     echo $row['message_num'];
     exit;
 }
开发者ID:hao-opentown,项目名称:autoreply,代码行数:8,代码来源:api.php

示例11: updateTagGroup

 protected function updateTagGroup($tag)
 {
     $sql = "UPDATE group_tags SET action='USED' WHERE tag = '{$tag}' \n";
     mysql::i()->query($sql);
 }
开发者ID:Git-Host,项目名称:sms,代码行数:5,代码来源:sms.class.php

示例12: fetchCustomerId

 private function fetchCustomerId($tag_id, $expirydate)
 {
     echo $sql = "SELECT * from tag_registered WHERE tag_id='{$tag_id}' AND date_expire = '{$expirydate}' \n";
     $result = mysql::i()->query($sql);
     $r = mysql::i()->fetch_object($result);
     return $r;
 }
开发者ID:Git-Host,项目名称:sms,代码行数:7,代码来源:tagExpiryReminder.class.php

示例13: checkTagValidityDatabase

 public function checkTagValidityDatabase($tags, $phone_number, $live)
 {
     foreach ($this->valid_tags as $tag) {
         $tag_no = utils::extractTagNo($tag);
         echo $sql = "SELECT * FROM group_tags WHERE tag = '{$tag_no}' \n";
         $q = mysql::i()->query($sql);
         $r = mysql::i()->fetch_array($q);
         if (empty($r)) {
             unset($this->valid_tags[$tag]);
             $this->invalid_tags[$tag] = $tag;
             $send['destinations'] = $phone_number;
             echo $send['body'] = 'Tag ' . $tag . ' is not recognised by our system please. Please check and try again or call ' . config::get('lost_bag_number');
             utils::recursiveCall('sendSMS', $send, 1, $live);
             $valid = false;
         }
         if ($r['action'] == 'USED') {
             unset($this->valid_tags[$tag]);
             $this->invalid_tags[$tag] = $tag;
             $send['destinations'] = $phone_number;
             echo $send['body'] = 'Tag ' . $tag . ' is already in use. Please check and try again or call ' . config::get('lost_bag_number');
             utils::recursiveCall('sendSMS', $send, 1, $live);
             $valid = false;
         }
         $type = $r['tag_type'];
         if ($type == 'paper') {
             $cost += '1.50';
         } else {
             $cost = 0;
         }
         $this->valid_tags[$tag] = $r;
         $this->valid_tags[$tag]['cost'] = $cost;
         //$this->tagData[$tag]['type'] = $type;
         //$this->tagData[$tag]['authorised'] = 1;
         unset($cost);
     }
     //foreach
     //$this->tagData['cost'] = $cost;
     return $valid;
 }
开发者ID:Git-Host,项目名称:sms,代码行数:39,代码来源:tag.class.php

示例14: array

 mysql::i()->query("truncate airports");
 validator::loadDictionaries(array('AirDB'));
 $iata = array('BKN', 'AAS', 'BOO');
 $air = array();
 foreach ($csv as $row) {
     //print_r($row);
     validator::validateInput($row);
     $cleanData = validator::getCleanData();
     $errors = validator::getErrors();
     if (!empty($errors)) {
         print_r($errors);
         exit;
     }
     $cleanData['Airport'] = str_replace(']', '', str_replace('[', '', $cleanData['Airport']));
     $sql = "INSERT INTO airports (ICAO,IATA,place,state,airport,country) VALUES ('{$cleanData['ICAO']}','{$cleanData['IATA']}','{$cleanData['Place']}','{$cleanData['State']}','{$cleanData['Airport']}','{$cleanData['Country']}') ";
     mysql::i()->query($sql);
     //if(in_array($cleanData['IATA'], $iata))continue;
     //print_r($cleanData);
     //print_r($cleanData);
     /*
     		if(in_array($cleanData['IATA'], $air)){
     			if($air[$cleanData['IATA']]['Country'] == 'USA'){
     				$air[$cleanData['IATA']] = $cleanData;
     				
     			}
     		}else{
     			$air[$cleanData['IATA']] = $cleanData;
     			
     		}*/
 }
 /*
开发者ID:Git-Host,项目名称:sms,代码行数:31,代码来源:process_airdb.php

示例15: chdir

<?php

chdir('../');
include_once 'init.inc.php';
$lock = 'nolock';
config::set('process_name', "Inbox - Register Email Address Reminder");
include_once 'start.inc.php';
try {
    $sql = "SELECT * FROM customer WHERE email='' AND approved=1 AND telephone<>'' AND username<>'' \n";
    $q = mysql::i()->query($sql);
    while ($r = mysql::i()->fetch_array($q)) {
        $send['destinations'] = utils::formatPhoneNumber($r['telephone']);
        $send['body'] = "Account {$r['username']} does not have a valid email address to recieve lost bag reports. Please log on to example.com to update your details. Text PIN STOP to cancel";
        utils::recursiveCall('sendSMS', $send, 1);
    }
} catch (emailException $e) {
    debug::output($e->getMessage());
} catch (Exception $e) {
    debug::output($e->getMessage());
    //$status->status(CRITICAL);
}
include 'end.inc.php';
开发者ID:Git-Host,项目名称:sms,代码行数:22,代码来源:registerEmailReminder.php


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