当前位置: 首页>>代码示例>>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;未经允许,请勿转载。