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


PHP DatabaseHandler::GetRow方法代码示例

本文整理汇总了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);
 }
开发者ID:pooya-alen1990,项目名称:sampleTalent,代码行数:7,代码来源:PERMISSIONS.php

示例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);
 }
开发者ID:pooya-alen1990,项目名称:sampleTalent,代码行数:7,代码来源:FAVORITE_USER.php

示例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);
 }
开发者ID:pooya-alen1990,项目名称:sampleTalent,代码行数:7,代码来源:BLOG_AUDIENCE.php

示例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;
 }
开发者ID:khoteevnd,项目名称:mb,代码行数:10,代码来源:Model_Tag_class.php

示例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);
     }
 }
开发者ID:xander-mbaka,项目名称:momentum,代码行数:11,代码来源:Event.php

示例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;
 }
开发者ID:khoteevnd,项目名称:mb,代码行数:13,代码来源:Model_Author_class.php

示例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;
     }
 }
开发者ID:xander-mbaka,项目名称:momentum,代码行数:50,代码来源:Statements.php

示例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;
 }
开发者ID:khoteevnd,项目名称:mb,代码行数:8,代码来源:Model_Post_class.php

示例9: quotations_SelectOneRandom

 public static function quotations_SelectOneRandom()
 {
     $sql = 'CALL `sp_quotations_SelectOneRandom`()';
     DatabaseHandler::Close();
     return DatabaseHandler::GetRow($sql);
 }
开发者ID:pooya-alen1990,项目名称:sampleTalent,代码行数:6,代码来源:QUOTATIONS.php

示例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']);
 }
开发者ID:xander-mbaka,项目名称:momentum,代码行数:12,代码来源:AccountingOrigi.php

示例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) {
        }
    }
开发者ID:xander-mbaka,项目名称:momentum,代码行数:27,代码来源:DomainSCM.php

示例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;
     }
 }
开发者ID:xander-mbaka,项目名称:momentum,代码行数:12,代码来源:DomainHRM.php

示例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>';
        }
开发者ID:pooya-alen1990,项目名称:sampleTalent,代码行数:31,代码来源:detail.php

示例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) {
     }
 }
开发者ID:xander-mbaka,项目名称:momentum,代码行数:9,代码来源:DomainPrjMgt.php

示例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);
 }
开发者ID:xander-mbaka,项目名称:momentum,代码行数:9,代码来源:subscription.php


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