本文整理汇总了PHP中DatabaseHandler::GetRow方法的典型用法代码示例。如果您正苦于以下问题:PHP DatabaseHandler::GetRow方法的具体用法?PHP DatabaseHandler::GetRow怎么用?PHP DatabaseHandler::GetRow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DatabaseHandler
的用法示例。
在下文中一共展示了DatabaseHandler::GetRow方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: permissions_SelectRow
public static function permissions_SelectRow($id)
{
$sql = 'CALL `sp_permissions_SelectRow`(:id)';
$params = array(':id' => $id);
DatabaseHandler::Close();
return DatabaseHandler::GetRow($sql, $params);
}
示例2: favorite_user_SelectRow
public static function favorite_user_SelectRow($id)
{
$sql = 'CALL `sp_favorite_user_SelectRow`(:id)';
$params = array(':id' => $id);
DatabaseHandler::Close();
return DatabaseHandler::GetRow($sql, $params);
}
示例3: blog_audience_SelectRow
public static function blog_audience_SelectRow($id)
{
$sql = 'CALL `sp_blog_audience_SelectRow`(:id)';
$params = array(':id' => $id);
DatabaseHandler::Close();
return DatabaseHandler::GetRow($sql, $params);
}
示例4: getTagById
public function getTagById($tag_id)
{
$params[] = $tag_id;
$sql = 'SELECT $this->table_name.*
FROM $this->table_name
WHERE tag_id = ?
';
$arr = DatabaseHandler::GetRow($sql, $params);
return $arr;
}
示例5: load
private function load()
{
$sql = 'SELECT * FROM events WHERE id = "' . $this->eventId . '"';
// Execute the query and return the results
$res = DatabaseHandler::GetRow($sql);
foreach ($res as $key => $value) {
//is this even legal - apparently yes!
$this->{$key} = $value;
//$this->__set($key, $value);
}
}
示例6: getOneAuthor
public function getOneAuthor($login, $pass)
{
$loginArr[] = $login;
$sql = 'SELECT * FROM authors WHERE login = ?';
$params = DatabaseHandler::GetRow($sql, $loginArr);
//var_dump($params);exit;
if (isset($params['login']) and $params['login'] == $login and (isset($params['pass']) and $params['pass'] == $pass)) {
//var_dump($params);exit;
$this->setAll($params);
return true;
}
return false;
}
示例7: GetPLStatament
public static function GetPLStatament($date, $period)
{
$ledgers = Ledger::GetPLLedgers();
$today = date('d/m/Y');
if ($date) {
if ($date == $today) {
foreach ($ledgers as &$ledger) {
$ledger->amount = $ledger->balance->amount;
}
return $ledgers;
} else {
$d1 = explode('/', $date);
$stamp = $d1[2] . $d1[0] . $d1[1] . '000000' + 0;
foreach ($ledgers as &$ledger) {
try {
$sql = 'SELECT * FROM general_ledger_entries WHERE ledger_id = ' . $ledger->id . ' AND stamp <= ' . $stamp . ' ORDER BY stamp DESC LIMIT 0,1';
$res = DatabaseHandler::GetRow($sql);
if ($res) {
$amount = $res['ledger_bal'];
} else {
$amount = 0;
}
$ledger->amount = $amount;
} catch (Exception $e) {
}
}
return $ledgers;
}
} else {
$split = explode(' - ', $period);
$d1 = explode('/', $split[0]);
$d2 = explode('/', $split[1]);
$lower = $d1[2] . $d1[1] . $d1[0] . '000000' + 0;
$upper = $d2[2] . $d2[1] . $d2[0] . '999999' + 0;
$sql = 'SELECT * FROM general_ledger_entries WHERE account_no = ' . intval($cid) . ' AND stamp BETWEEN ' . $lower . ' AND ' . $upper . ' ORDER BY id ASC';
foreach ($ledgers as &$ledger) {
try {
$sql = 'SELECT * FROM general_ledger_entries WHERE ledger_id = ' . $ledger->id . ' AND stamp BETWEEN ' . $lower . ' AND ' . $upper . ' ORDER BY stamp ASC';
$res = DatabaseHandler::GetAll($sql);
$amount = 0.0;
foreach ($res as $tx) {
$amount += $tx['amount'];
}
$ledger->amount = $amount;
} catch (Exception $e) {
}
}
return $ledgers;
}
}
示例8: GetOnePost
public function GetOnePost($post_id)
{
$params[] = $post_id;
$sql = 'SELECT * FROM (SELECT * FROM posts WHERE post_id = ?) as t_posts
LEFT JOIN authors ON t_posts.author_id = authors.author_id;';
$arr = DatabaseHandler::GetRow($sql, $params);
return $arr;
}
示例9: quotations_SelectOneRandom
public static function quotations_SelectOneRandom()
{
$sql = 'CALL `sp_quotations_SelectOneRandom`()';
DatabaseHandler::Close();
return DatabaseHandler::GetRow($sql);
}
示例10: Create
public static function Create($name)
{
$phenomena = 'Number';
$sql2 = 'SELECT * FROM units WHERE name = "' . $name . '" AND phenomena = "' . $phenomena . '"';
$res = DatabaseHandler::GetRow($sql2);
if (empty($res)) {
$sql = 'INSERT INTO units (name, phenomena, symbol) VALUES ("' . $name . '", "' . $phenomena . '", "' . $symbol . '")';
DatabaseHandler::Execute($sql);
$res = DatabaseHandler::GetRow($sql2);
}
return new Enumerable($res['id'], $res['phenomena'], $res['name'], $res['symbol']);
}
示例11: MakePayment
public static function MakePayment($party, $scope, $supplierid, $amount, $ledgerId, $mode, $voucher, $descr)
{
try {
$supplier = Supplier::GetSupplier($supplierid);
$grns = "";
/*foreach ($payments as $key => $payment) {
$grns .= $key.",";
}*/
$descr .= ' (' . $voucher . ')';
$sql = 'INSERT INTO payments (party_id, grns, amount, ledger_id, mode, voucher_no, description, status) VALUES
(' . $supplierid . ', "' . $grns . '", ' . $amount . ', ' . $ledgerId . ', "' . $mode . '", "' . $voucher . '", "' . $descr . '", 0)';
DatabaseHandler::Execute($sql);
$sql2 = 'SELECT * FROM payments WHERE party_id = ' . $supplierid . ' ORDER BY id DESC LIMIT 0,1';
$res = DatabaseHandler::GetRow($sql2);
$acc = Account::GetAccountByNo($supplierid, 'suppliers', 'Creditors');
$expv = ExpenseVoucher::CreateSupplierProjectExpense($party, $scope, $amount, $acc->ledgerId, $voucher, $descr);
if ($expv) {
$tx = self::initialize($res);
$tx->expVoucher = $expv;
return $tx;
} else {
return false;
}
return self::initialize($res);
} catch (Exception $e) {
}
}
示例12: GetSlip
public static function GetSlip($id)
{
try {
$sql = 'SELECT * FROM payslips WHERE id = ' . $id;
$entry = DatabaseHandler::GetRow($sql);
$slip = new PaySlip(Employee::GetEmployee($entry['party_id']), $entry['month'], $entry['paid']);
$slip->populate($entry['id']);
return $slip;
} catch (Exception $e) {
return false;
}
}
示例13: die
<?php
/**
* Created by PhpStorm.
* User: pooya
* Date: 9/7/15
* Time: 5:20 PM
*/
require_once "../core/core.php";
if (isset($_GET["title"])) {
$blog = DatabaseHandler::GetRow("SELECT * FROM `blogs` WHERE `title_en` = '{$_GET['title']}' ; ");
if (!isset($blog["id"])) {
die("پست مورد نظر وجود ندارد.");
}
$page_title = "Talentyab | {$blog['title_en']}";
$keywords = "";
$keywords_array = DatabaseHandler::GetAll("SELECT * FROM `blog_keywords` WHERE `blog_id` = '{$blog['id']}' ; ");
foreach ($keywords_array as $keyword) {
$keywords .= $keyword["keyword"] . " , ";
}
$author = ADMINS::admins_SelectRow($blog["admin_id"]);
$author_name = $author["first_name"] . " " . $author["last_name"];
$comments = DatabaseHandler::GetAll("SELECT * FROM `comments` WHERE `activate` = '1' AND `blog_id` = '{$blog['id']}' AND `comment_id` = '0' ; ");
$comments_echo = '';
foreach ($comments as $comment) {
$avatar = "";
if ($comment["admin_id"] == "1") {
$avatar = '<a class="profile-pic" href="#"><img src="../view/images/logo_thumb.png"></a>';
} else {
$avatar = '<a class="profile-pic avatar-letter" style="background-color:' . G::randomColor($comment["id"]) . '; " href="#">' . G::convertToAvatar($comment["full_name"]) . '</a>';
}
示例14: Get
public static function Get($id)
{
try {
$sql = 'SELECT * FROM land_docs WHERE id = ' . $id . '';
$res = DatabaseHandler::GetRow($sql);
return self::initialize($res);
} catch (Exception $e) {
}
}
示例15: GetBlogDetails
public static function GetBlogDetails($blogId)
{
// Build SQL query
$sql = 'CALL blog_get_blog_details(:blog_id)';
// Build the parameters array
$params = array(':blog_id' => $blogId);
// Execute the query and return the results
return DatabaseHandler::GetRow($sql, $params);
}