本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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));
}