當前位置: 首頁>>代碼示例>>PHP>>正文


PHP query::get方法代碼示例

本文整理匯總了PHP中query::get方法的典型用法代碼示例。如果您正苦於以下問題:PHP query::get方法的具體用法?PHP query::get怎麽用?PHP query::get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在query的用法示例。


在下文中一共展示了query::get方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 public function __construct($owner)
 {
     $this->owner = $owner;
     $query = new query();
     $query->Select("name", "value")->From("option")->Where("site", "=", $owner)->exec("all");
     while ($query->next()) {
         switch ($query->get('value')) {
             case "true":
                 $this->option[$query->get('name')] = true;
                 break;
             case "false":
             case "":
                 $this->option[$query->get('name')] = false;
                 break;
             default:
                 $this->option[$query->get('name')] = $query->get('value');
                 break;
         }
     }
 }
開發者ID:homework-bazaar,項目名稱:SnakePHP,代碼行數:20,代碼來源:class.option.php

示例2: array

 static function get_globals($get, $post)
 {
     self::$get = self::clean_globals($get, array());
     self::$post = self::clean_globals($post, array());
     if (isset($post['remember'])) {
         $md5 = md5(serialize($post));
         if (obj::db()->sql('select id from input_filter where md5 = "' . $md5 . '"', 2)) {
             unset($post);
         } else {
             obj::db()->insert('input_filter', array($md5, time()));
         }
     }
     unset($_GET, $_POST);
     return array(self::$get, self::$post);
 }
開發者ID:4otaku,項目名稱:4otaku,代碼行數:15,代碼來源:wrapper.php

示例3: query

<?php

require_once '../../../resources/php/sql.php';
$results = new query("SELECT * FROM dhs16_user WHERE social = '" . $_POST['social'] . "';");
$user_exists = false;
foreach ($results->get() as $row) {
    $user_exists = true;
}
if (!$user_exists) {
    $sqlUser = new query("INSERT INTO dhs16_user (id, name, phone, seat, social) VALUES (NULL,'" . strtolower($_POST['name']) . "','" . $_POST['phone'] . "','" . $_POST['seat'] . "','" . $_POST['social'] . "');");
    $sqlUser->execute();
}
$checkIn = date("Y-m-d H:i:s");
$sqlProblem = new query("INSERT INTO dhs16_problem (id, header, description, parts, name, social, check_in) VALUES (NULL,'" . $_POST['problem'] . "','" . $_POST['problemDesc'] . "','" . $_POST['parts'] . "','" . $_POST['name'] . "','" . $_POST['social'] . "','" . $checkIn . "');");
$sqlProblem->execute();
header('Location: ../../receipt.php?social=' . $_POST['social']);
//var_dump($sqlProblem->get());
開發者ID:Norrbrinken,項目名稱:DHS16,代碼行數:17,代碼來源:in.php

示例4: json_encode

<?php

require_once '../../resources/php/sql.php';
$sql = new query("SELECT * FROM dhs16_problem;");
$queue = 0;
//queue
foreach ($sql->get() as $row) {
    if ($row["check_out"] == "0000-00-00 00:00:00") {
        $queue++;
    }
}
//problem
$sql = new query("SELECT * FROM dhs16_issue ORDER BY id ASC;");
foreach ($sql->get() as $row) {
    $type = $row["type"];
    $dhrow = $row["row"];
}
echo json_encode(array("queue" => $queue, "problem" => array("type" => $type, "row" => $dhrow)));
開發者ID:Norrbrinken,項目名稱:DHS16,代碼行數:18,代碼來源:call.php

示例5: option

 /**
  * 
  * Description : Retourne ou modifie les paramètres personnalisés de l'utilisateur.
  * Paramètres  :
  *     [$key]   - (string) : Nom de l'option
  * 	   [$value] - (string) : Valeur de l'option.
  * Retour      :
  *     - (bool) "true"  : l'option a été créée
  *     - (bool) "false" : l'option n'existe pas
  *     - (array)	: Tableau associatif de toutes les fonctions si la méthode est appelée sans aucun paramètre
  *     - (string)       : Valeur l'option dans la BDD si le paramètre $value n'est pas renseignée lors de l'appel de la méthode.
  */
 public function option($key = false, $value = false)
 {
     if (count($this->option) == 0) {
         $req = new query();
         $req->select('key', 'value')->from("user_option")->where('owner', '=', $this->get('id'))->exec("ALL");
         while ($result = $req->next()) {
             $this->option[$req->get("key")] = $req->get("value");
         }
     }
     if (!$key) {
         return $this->option;
     } elseif (!$value) {
         if (isset($this->option[$key])) {
             return $this->option[$key];
         } else {
             return false;
         }
     } else {
         if (!isset($this->option[$key])) {
             $this->create[] = $key;
             $this->option[$key] = $value;
             return true;
         } elseif ($this->option[$key] != $value) {
             $this->change[] = $key;
             $this->option[$key] = $value;
             return true;
         } else {
             return false;
         }
     }
 }
開發者ID:homework-bazaar,項目名稱:SnakePHP,代碼行數:43,代碼來源:plugin.user.php

示例6: all

 /**
  * @param array $columns
  * @return mixed
  */
 public function all($columns = array('*'))
 {
     return $this->query->get($columns);
 }
開發者ID:viglucci,項目名稱:laravel-repositories-parent,代碼行數:8,代碼來源:Repository.php

示例7: substr

    echo "SSN: " . substr($row['social'], 0, 8) . "-XXXX";
    ?>
</li>
                        <li><?php 
    echo "Seat: " . $row['seat'];
    ?>
</li>
                        <li class=""><?php 
    echo "Phonenumber: " . $row['phone'];
    ?>
</li>
                        <li class="no-print"><button id="print" class="button">Print</button></li>
                    </ul>
              	</div>
        <?php 
    foreach ($sqlProblem->get() as $rowProblem) {
        ?>
				<?php 
        if ($rowProblem['check_out'] == "0000-00-00 00:00:00") {
            echo '<div class="column medium-6">';
        } else {
            echo '<div class="column medium-6 no-print">';
        }
        ?>
            	 
                    <ul class="pricing-table no-bullet text-left">
                    	<li class="title"><?php 
        echo $rowProblem['header'];
        ?>
</li>
                        <li><?php 
開發者ID:Norrbrinken,項目名稱:DHS16,代碼行數:31,代碼來源:receipt.php


注:本文中的query::get方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。