本文整理匯總了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));
}