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


PHP DB::findAll方法代码示例

本文整理汇总了PHP中DB::findAll方法的典型用法代码示例。如果您正苦于以下问题:PHP DB::findAll方法的具体用法?PHP DB::findAll怎么用?PHP DB::findAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DB的用法示例。


在下文中一共展示了DB::findAll方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getAnswer_by_qid

 /**
  * @param $qid
  * @return array
  * 根据问题编号查找所有问题答案
  */
 function getAnswer_by_qid($qid)
 {
     $res = array();
     if (is_array($qid)) {
         foreach ($qid as $id) {
             $sql = 'select * from ' . $this->_answerTable . ' where qid=' . $id . ' order by dateline desc';
             $temp = DB::findAll($sql);
             if (!empty($temp)) {
                 $res[] = $temp;
             }
         }
     } else {
         $sql = 'select * from ' . $this->_answerTable . ' where qid=' . $qid . ' order by dateline desc';
         $temp = DB::findAll($sql);
         if (is_array($temp)) {
             foreach ($temp as $key => $val) {
                 $val['dateline'] = date("Y-m-d H:i:s  T", $val['dateline']);
                 $temp[$key] = $val;
             }
         }
         if (!empty($temp)) {
             $res = $temp;
         }
     }
     return $res;
 }
开发者ID:Twinkling,项目名称:BanXing,代码行数:31,代码来源:qaModel.class.php

示例2: getOneMonthSalaryDetail

 function getOneMonthSalaryDetail($usercode, $Year, $Month)
 {
     //表格数据
     $sql = "SELECT filed_index\n                from " . $this->_filetable . "\n                where activestatus = '0'\n                ORDER BY sortnum";
     $fileArr = DB::findAll($sql);
     //循环数据生成SQL语句  将detail表橫表变竖表
     $sql = "";
     foreach ($fileArr as $k => $val) {
         $sql .= "SELECT \"" . $val["filed_index"] . "\" as filename," . $val["filed_index"] . " as num from " . $this->_dtailtable . " WHERE userno=\"" . $usercode . "\"\n                 and year=\"" . $Year . "\" and month=\"" . $Month . "\" union ";
     }
     $sql = rtrim(trim($sql), 'union ');
     $sql = "SELECT filed_index,chinese_name,english_name,sortnum,\n                CASE WHEN isstrong = 0 THEN '' WHEN isstrong = 1 THEN 'uk-text-bold' END AS isstrong,\n                CASE WHEN islarger = 0 THEN '' WHEN islarger = 1 THEN 'uk-text-large' END AS islarger,\n                color,detailtable.num FROM " . $this->_filetable . " left join (" . $sql . ") detailtable\n               on " . $this->_filetable . ".filed_index=detailtable.filename\n               where salary_filed.activestatus='0'\n               order by " . $this->_filetable . ".sortnum";
     return DB::findAll($sql);
 }
开发者ID:suollk,项目名称:KLBSalary,代码行数:14,代码来源:salaryModel.class.php

示例3: getAll

 function getAll($sid)
 {
     $sql = 'select * from ' . $this->_table . ' where sid=' . $sid;
     $temp = DB::findAll($sql);
     if (is_array($temp)) {
         foreach ($temp as $key => $val) {
             $val['dateline'] = date("Y-m-d  T", $val['dateline']);
             $temp[$key] = $val;
         }
     } elseif (!empty($temp)) {
         $temp['dateline'] = date("Y-m-d  T", $temp['dateline']);
     }
     return $temp;
 }
开发者ID:Twinkling,项目名称:BanXing,代码行数:14,代码来源:strategyModel.class.php

示例4: findOne

 public function findOne($where = array(), $field = array('*'))
 {
     //array('id'=>1,'pid'=>1)
     $fieldstr = implode(',', $field);
     if (count($where) >= 1) {
         foreach ($where as $k => $v) {
             $str .= $k . '="' . $v . '" and ';
         }
         $str = substr($str, 0, -5);
         $sql = 'select ' . $fieldstr . ' from ' . $this->_table . ' where ' . $str;
     } else {
         $sql = 'select ' . $fieldstr . ' from ' . $this->_table;
     }
     return DB::findAll($sql);
 }
开发者ID:xtzlyp,项目名称:xtzlyp_blog,代码行数:15,代码来源:ContentModel.class.php

示例5: findall

 public function findall($where = array())
 {
     //array('id'=>1,'pid'=>1)
     if (count($where) >= 1) {
         foreach ($where as $k => $v) {
             $str .= $k . '="' . $v . '" and ';
         }
         $str = substr($str, 0, -5);
         $sql = 'select * from ' . $this->_table . ' where ' . $str;
     } else {
         $sql = 'select * from ' . $this->_table;
     }
     //print_r($sql);
     //die();
     return DB::findAll($sql);
 }
开发者ID:xtzlyp,项目名称:xtzlyp_blog,代码行数:16,代码来源:TagModel.class.php

示例6: getAll

 function getAll($sid)
 {
     $sql = 'select * from ' . $this->_table . " where sid=" . $sid . ' order by dateline desc';
     $temp = DB::findAll($sql);
     if (is_array($temp)) {
         foreach ($temp as $key => $val) {
             $username = unserialize($val['username']);
             if (is_array($username)) {
                 $val['username'] = implode(",", $username);
             }
             $val['dateline'] = date("Y-m-d  T", $val['dateline']);
             $temp[$key] = $val;
         }
     } elseif (!empty($temp)) {
         $temp['username'] = unserialize($temp['username']);
         $temp['dateline'] = date("Y-m-d  T", $temp['dateline']);
     }
     return $temp;
 }
开发者ID:Twinkling,项目名称:BanXing,代码行数:19,代码来源:partnerModel.class.php

示例7: getinquirydetail

 function getinquirydetail($inquireid)
 {
     //获取调查问卷题目详情
     $sql = "select * from " . $this->_inquiryquestion . " where inquireid=\"" . $inquireid . "\" order by sortnum";
     $inquiryquestionArr = DB::findAll($sql);
     $sql = "select " . $this->_inquiryoption . ".* from " . $this->_inquiryquestion . "," . $this->_inquiryoption . " where " . $this->_inquiryoption . ".questionid=" . $this->_inquiryquestion . ".id" . " and " . $this->_inquiryquestion . ".inquireid=\"" . $inquireid . "\" order by sortnum";
     $inquiryoptionArr = DB::findAll($sql);
     //将选项作为数组直接插入到问题后
     for ($j = 0; $j < count($inquiryquestionArr); $j++) {
         if (isset($newoptionArr)) {
             unset($newoptionArr);
         }
         for ($i = 0; $i < sizeof($inquiryoptionArr); $i++) {
             if ($inquiryoptionArr[$i]["questionid"] == $inquiryquestionArr[$j]["id"]) {
                 $newoptionArr[] = $inquiryoptionArr[$i];
             }
         }
         if (isset($newoptionArr)) {
             $inquiryquestionArr[$j]["data"] = $newoptionArr;
         }
     }
     return $inquiryquestionArr;
 }
开发者ID:suollk,项目名称:KLBSalary,代码行数:23,代码来源:inquiryModel.class.php

示例8: findAll

 function findAll($appid)
 {
     $sql = 'select * from ' . $this->_table . ' where appid="' . $appid . '"';
     return DB::findAll($sql);
 }
开发者ID:Hikyu,项目名称:Tam,代码行数:5,代码来源:userModel.class.php

示例9: array

     <?php 
echo '<h3 align="center">Entrenadores Inactivos</h3>
     <table class="table table-hover">
     <tr>
     <td>Folio</td>
     <td>Nombre</td>
     <td>Apellidos</td>
     <td>Alias</td>
     <td>Activar</td>
     </tr>';
$susp0 = $_POST['susp0'];
$data = array();
$data = array('suspendido' => $susp0);
$db = new DB("root", "110992", "localhost", "centrospokemon");
$entrenadores = $db->findAll('entrenadores', $data);
//$db->pretty();
foreach ($entrenadores as $entre) {
    ?>
     <tr>
       <td><?php 
    echo $entre['id'];
    ?>
</td>
       <td><?php 
    echo $entre['nombre'];
    ?>
</td>
       <td><?php 
    echo $entre['apellidos'];
    ?>
开发者ID:alfredo-barron,项目名称:Pokemon-Hoenn,代码行数:30,代码来源:consultaentrenador.php

示例10: json_encode

<?php

require '../../boot.php';
require '../../session.php';
if (!isset($session) || $session->auth == "") {
    Common::Error(401, 'json');
}
$req = Request::all($_REQUEST);
if (empty($req)) {
    exit;
}
$users = DB::findAll("users_detail", $req);
for ($i = 0; $i < count($users); $i++) {
    $users[$i]->password = 'xxxxxxxx';
}
echo json_encode($users);
exit;
开发者ID:WisnuDiStefano,项目名称:v4,代码行数:17,代码来源:detail.php

示例11: json_encode

<?php

require '../../boot.php';
require '../../session.php';
if (!isset($session) || $session->auth == "") {
    Common::Error(401, 'json');
}
$req = Request::all($_REQUEST);
if (empty($req)) {
    $users = DB::get("users");
    for ($i = 0; $i < count($users); $i++) {
        $users[$i]->password = 'xxxxxxxx';
        $users[$i]->satker = Suggest::getSatker($users[$i]->kd_subunit);
    }
    echo json_encode($users);
    exit;
}
$users = DB::findAll("users", $req);
for ($i = 0; $i < count($users); $i++) {
    $users[$i]->password = 'xxxxxxxx';
    $users[$i]->satker = Suggest::getSatker($users[$i]->kd_subunit);
}
echo json_encode($users);
exit;
开发者ID:WisnuDiStefano,项目名称:v4,代码行数:24,代码来源:list.php

示例12: array

     <?php 
echo '<h3 align="center">Regeneradores Inactivos</h3>
     <table class="table table-hover">
     <tr>
     <td>Folio</td>
     <td>Slots</td>
     <td>Slots Funcionales</td>
     <td>Mantenimiento</td>
     <td>Centro Pokemon</td>
     <td>Activar</td>
     </tr>';
$susp0 = $_POST['susp0'];
$data = array();
$data = array('suspendido' => $susp0);
$db = new DB("root", "110992", "localhost", "centrospokemon");
$enfermeras = $db->findAll('vista_regeneradores', $data);
//$db->pretty();
foreach ($enfermeras as $enfe) {
    $mante = $enfe['esta_mantenimiento'];
    if ($mante == 1) {
        $imprimir = "Si";
    } else {
        $imprimir = "No";
    }
    ?>
     <tr>
      <td><?php 
    echo $enfe['id'];
    ?>
</td>
      <td><?php 
开发者ID:alfredo-barron,项目名称:Pokemon-Hoenn,代码行数:31,代码来源:consultaregeneradores.php

示例13: foreach

    $centros = $db->findAll('catalogo_estatus', $data);
    foreach ($centros as $cen) {
        ?>
     <option value="<?php 
        echo $centropoke;
        ?>
" select><?php 
        echo $cen['nombre'];
        ?>
</option>
     <?php 
    }
    ?>
     <?php 
    $db = new DB("root", "110992", "localhost", "centrospokemon");
    $estatus = $db->findAll('catalogo_estatus');
    //$db->pretty();
    foreach ($estatus as $est) {
        ?>
     <option value="<?php 
        echo $poke['estatus'];
        ?>
" ><?php 
        echo $est['nombre'];
        ?>
</option>
     <?php 
    }
    ?>
     </select>
     </div>
开发者ID:alfredo-barron,项目名称:Pokemon-Hoenn,代码行数:31,代码来源:updatepokemon.php

示例14: array

    echo $cata['habilidad'];
    ?>
<br>
         </div>
          <?php 
}
?>
       </td>
      <td>
     <?php 
#$id = $_GET['id'];
$id_prevolucion = $id;
$data = array();
$data = array('id_prevolucion' => $id_prevolucion);
$db = new DB("root", "110992", "localhost", "centrospokemon");
$catalogos = $db->findAll('vista_evolucion', $data);
foreach ($catalogos as $cata) {
    ?>
       <div align="center">
        <b>Evolucion: <b> 
       <b><?php 
    echo $cata['especie'];
    ?>
</b><br>
      <img src="./images/<?php 
    echo $cata['imagen'];
    ?>
">
      </div>
     <?php 
}
开发者ID:alfredo-barron,项目名称:Pokemon-Hoenn,代码行数:31,代码来源:perfilpokemon.php

示例15: DB

<?php

include "DB.php";
?>
<html>
<head>
  <title>To Do List</title>
</head>
<body>
  <h1>To Do List</h1>
  <form action="save.php" method="POST">
    <input type="text" id="task" name="task" placeholder="Write a task">
    <button type="submit">Guardar</button>
  </form>
  <a href="json.php">Ver en JSON</a>
  <hr/>
<?php 
$db = new DB("root", "110992", "localhost", "todo");
$tareas = $db->findAll('tasks');
//$db->pretty();
foreach ($tareas as $tarea) {
    echo $tarea['id'] . " - " . $tarea['task'] . " <a style=\"color:red\" href=\"delete.php?id=" . $tarea['id'] . "\">&times;</a> | <a href=\"update.php?id=" . $tarea['id'] . "\">Editar</a><br/>";
}
?>
</body>
</html>
开发者ID:alfredo-barron,项目名称:Pokemon-Hoenn,代码行数:26,代码来源:index.php


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