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


PHP Db::getConection方法代码示例

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


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

示例1: add

 public static function add($uid, $pid)
 {
     $db = Db::getConection();
     $stmt = $db->prepare("INSERT INTO  us_post (uid, pid)\nVALUES (:uid, :pid)");
     $res = $stmt->execute(array(':uid' => $uid, ':pid' => $pid));
     return $res;
 }
开发者ID:kittiwake,项目名称:gm2,代码行数:7,代码来源:User_post.php

示例2: dellFree

 public static function dellFree($uid, $date)
 {
     $db = Db::getConection();
     $stmt = $db->prepare("DELETE FROM `freemen` WHERE `uid` = :uid AND `date` = :date");
     $res = $stmt->execute(array('uid' => $uid, 'date' => $date));
     return $res;
 }
开发者ID:kittiwake,项目名称:gm2,代码行数:7,代码来源:Freemen.php

示例3: updateUsersByParam

 public static function updateUsersByParam($pole, $val, $oid)
 {
     $db = Db::getConection();
     $res = $db->prepare('UPDATE `users` SET `' . $pole . '`=:val WHERE `id`=:oid');
     $answer = $res->execute(array(':val' => $val, ':oid' => $oid));
     return $answer;
 }
开发者ID:kittiwake,项目名称:gm2,代码行数:7,代码来源:Users.php

示例4: addMounting

 public static function addMounting($oid, $uid, $datedb)
 {
     $db = Db::getConection();
     $res = $db->prepare('INSERT INTO `mounting`(`oid`,`uid`,`m_date`) VALUES (:oid, :uid, :date)');
     $answer = $res->execute(array(':oid' => $oid, ':uid' => $uid, ':date' => $datedb));
     echo $uid;
     return $answer;
 }
开发者ID:kittiwake,项目名称:gm2,代码行数:8,代码来源:Mounting.php

示例5: getPosts

 public static function getPosts()
 {
     $db = Db::getConection();
     $res = $db->prepare('SELECT * FROM `posts`');
     $res->execute();
     $res->setFetchMode(PDO::FETCH_ASSOC);
     while ($row = $res->fetch()) {
         $posts[$row['id']] = $row['list'];
     }
     return $posts;
 }
开发者ID:kittiwake,项目名称:gm2,代码行数:11,代码来源:Posts.php

示例6: getAllDillers

 public static function getAllDillers()
 {
     $db = Db::getConection();
     $userList = array();
     $res = $db->prepare('SELECT * FROM `dillers`');
     $res->execute();
     $res->setFetchMode(PDO::FETCH_ASSOC);
     while ($row = $res->fetch()) {
         $userList[] = $row;
     }
     return $userList;
 }
开发者ID:kittiwake,项目名称:gm2,代码行数:12,代码来源:Dillers.php

示例7: getSamples

 public static function getSamples()
 {
     $db = Db::getConection();
     $list = array();
     $res = $db->prepare('SELECT * FROM `sample_sms`');
     $res->execute();
     $res->setFetchMode(PDO::FETCH_ASSOC);
     while ($row = $res->fetch()) {
         $list[$row['id']] = $row;
     }
     return $list;
 }
开发者ID:kittiwake,项目名称:gm2,代码行数:12,代码来源:Sms.php

示例8: getClaimsNoSum

    public static function getClaimsNoSum()
    {
        $db = Db::getConection();
        $orderList = array();
        $res = $db->prepare('
SELECT `oid`, `contract`, `sum`, (SELECT `name` FROM `users` WHERE `users`.`id` = `orders`. `technologist`) AS `tech`
FROM `orders` , `order_stan`
WHERE `contract` REGEXP \'^.*[РД][1-9]?$\'
AND `orders`.`id` = `order_stan`.`oid`
AND `orders`.`sum` < 1000
AND `order_stan`.`otgruz_end`!= \'2\'
');
        $res->execute();
        $res->setFetchMode(PDO::FETCH_ASSOC);
        while ($row = $res->fetch()) {
            $orderList[] = $row;
        }
        return $orderList;
    }
开发者ID:kittiwake,项目名称:gm2,代码行数:19,代码来源:Order.php

示例9: setNote

 public static function setNote($oid, $note)
 {
     $db = Db::getConection();
     $res = $db->prepare("\nINSERT INTO `notes` (`oid`, `note` , `date`)\nVALUES (:oid, :note, CURDATE())\n\t  ");
     $res->execute(array('oid' => $oid, 'note' => $note));
 }
开发者ID:kittiwake,项目名称:gm2,代码行数:6,代码来源:Notes.php


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