国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

? php教程 PHP開(kāi)發(fā) Zend Framework ?????? ?? ?? ?? ??

Zend Framework ?????? ?? ?? ?? ??

Jan 05, 2017 am 09:31 AM

? ?? ????? Zend Framework ??????? ?? ??? ???? ????. ??? ?? ????? ?? ??? ??????.

?:

<?php
//
// SELECT *
//   FROM round_table
//   WHERE noble_title = "Sir"
//   ORDER BY first_name
//   LIMIT 10 OFFSET 20
//
// 你可以使用一種重復(fù)定義的方式...
$select->from(&#39;round_table&#39;, &#39;*&#39;);
$select->where(&#39;noble_title = ?&#39;, &#39;Sir&#39;);
$select->order(&#39;first_name&#39;);
$select->limit(10,20);
// ...或者使用一種連續(xù)定義的方式:
$select->from(&#39;round_table&#39;, &#39;*&#39;)
->where(&#39;noble_title = ?&#39;, &#39;Sir&#39;)
->order(&#39;first_name&#39;)
->limit(10,20);
// 但是,讀取數(shù)據(jù)的方法相同
$sql = $select->__toString();
$result = $db->fetchAll($sql);
// 對(duì)于以上任一種方式,你都可以傳送$select對(duì)象本身
// 使用Zend_Db_Select對(duì)象的 __toString()方法就可以得到查詢語(yǔ)句
$result = $db->fetchAll($select);
?>

????? ???? ?? ???? ??? ?? ?? ???? ????? ??? ?? ????.

<?php
//
// SELECT *
//   FROM round_table
//   WHERE noble_title = "Sir"
//   ORDER BY first_name
//   LIMIT 10 OFFSET 20
//
$select->from(&#39;round_table&#39;, &#39;*&#39;)
  ->where(&#39;noble_title = :title&#39;)
  ->order(&#39;first_name&#39;)
  ->limit(10,20);
// 讀取結(jié)果使用綁定的參數(shù)
$params = array(&#39;title&#39; => &#39;Sir&#39;);
$result = $db->fetchAll($select, $params);
?>

?? ????? ?? ?? ??? ??

??? ????? ?? ?? ???? ?? ?? from() ???? ???? ??? ??? ??? ?? ??? ? ???? ?????. ??? ??? ? ?? ?? ???? ??? ? ???, from() ???? ??? ?? ?? ? ??? ? ????.

<?php
// 創(chuàng)建一個(gè)$db對(duì)象,假定adapter為Mysql
$select = $db->select();
// 從some_table表中讀取a,b,c三列
$select->from(&#39;some_table&#39;, &#39;a, b, c&#39;);
// 同樣可以:
$select->from(&#39;some_table&#39;, array(&#39;a&#39;, &#39;b&#39;, &#39;c&#39;);
// 從foo AS bar表中讀取列bar.col
$select->from(&#39;foo AS bar&#39;, &#39;bar.col&#39;);
// 從foo, bar兩個(gè)表中讀取foo.col 別名為col1,bar.col別名為col2
$select->from(&#39;foo&#39;, &#39;foo.col AS col1&#39;);
$select->from(&#39;bar&#39;, &#39;bar.col AS col2&#39;);
?>

?? ??? ?? ??

??? ?? ??? ???? ?? ???? Join() ???? ??? ? ????. ?? ??? ?? ??? ?? ??? ??? ??? ?? ??? ??? ?? ??(??: ? ??? ?? ???? ?? ??? ?? ???), ????? ??? ? ??? ?????. ?????, ??? ?? Join() ???? ??? ? ????.

<?php
// 創(chuàng)建一個(gè)$db對(duì)象,假定adapter為Mysql.
$select = $db->select();
//
// SELECT foo.*, bar.*
//   FROM foo
//   JOIN bar ON foo.id = bar.id
//
$select->from(&#39;foo&#39;, &#39;*&#39;);
$select->join(&#39;bar&#39;, &#39;foo.id = bar.id&#39;, &#39;*&#39;);
?>

WHERE ??

where ??? ???? ?? ?? where() ???? ??? ? ????. ?? ?? ???? ??? ?? ?? using?

<?php
// 創(chuàng)建一個(gè)$db對(duì)象,調(diào)用SELECT方法.
$select = $db->select();
//
// SELECT *
//   FROM round_table
//   WHERE noble_title = "Sir"
//   AND favorite_color = "yellow"
//
$select->from(&#39;round_table&#39;, &#39;*&#39;);
$select->where(&#39;noble_title = "Sir"&#39;); // embedded value
$select->where(&#39;favorite_color = ?&#39;, &#39;yellow&#39;); // quoted value
//
// SELECT *
//   FROM foo
//   WHERE bar = "baz"
//   OR id IN("1", "2", "3")
//
$select->from(&#39;foo&#39;, &#39;*&#39;);
$select->where(&#39;bar = ?&#39;, &#39;baz&#39;);
$select->orWhere(&#39;id IN(?)&#39;, array(1, 2, 3);
?>

GROUP BY ?

??? ?? group() ???? ?? ? ???? ??? ???? ???? ? ????

<?php
// 創(chuàng)建一個(gè)$db對(duì)象,調(diào)用SELECT方法.
$select = $db->select();
//
// SELECT COUNT(id)
//   FROM foo
//   GROUP BY bar, baz
//
$select->from(&#39;foo&#39;, &#39;COUNT(id)&#39;);
$select->group(&#39;bar&#39;);
$select->group(&#39;baz&#39;);
// 同樣可以這樣調(diào)用 group() 方法:
$select->group(&#39;bar, baz&#39;);
// 還可以:
$select->group(array(&#39;bar&#39;, &#39;baz&#39;));
?>

HAVING ??

?? ??? ?? ??? ???? ?? ???? ??() ???? ??? ? ????. ? ???? where() ???? ??? ??? ????.

have() ???? ?? ? ???? ? ?? ??? ?? "??"?? "or" ??? ???? ?? ?? orHaving() ???? ??? ? ????. .

<?php
// 創(chuàng)建一個(gè)$db對(duì)象,調(diào)用SELECT方法.
$select = $db->select();
//
// SELECT COUNT(id) AS count_id
//   FROM foo
//   GROUP BY bar, baz
//   HAVING count_id > "1"
//
$select->from(&#39;foo&#39;, &#39;COUNT(id) AS count_id&#39;);
$select->group(&#39;bar, baz&#39;);
$select->having(&#39;count_id > ?&#39;, 1);
?>

ORDER BY ?

??? ?? order() ???? ?? ? ???? ??? ????

<?php
// 創(chuàng)建一個(gè)$db對(duì)象,調(diào)用SELECT方法.
$select = $db->select();
//
// SELECT * FROM round_table
//   ORDER BY noble_title DESC, first_name ASC
//
$select->from(&#39;round_table&#39;, &#39;*&#39;);
$select->order(&#39;noble_title DESC&#39;);
$select->order(&#39;first_name&#39;);
// 同樣可以這樣調(diào)用 order() 方法:
$select->order(&#39;noble_title DESC, first_name&#39;);
// 還可以:
$select->order(array(&#39;noble_title DESC&#39;, &#39;first_name&#39;));
?>

?? ? ???? ??? ? ????. LIMIT ??? ??

Zend_db_select? ?????? ???? ??? ??? ??? ? ????. mysql ? postgresql? ?? ?? ??????? ?? ????? "limit:count" ??? ????? ?? ???? ?? ????? ????.

Microsoft? SQL Server, Oracle ? ?? ?? ??????? ?? ????? Limit ?? ?? ???? ?? ??? Limit ??? ???? ?? ?? ???? ????. MS-SQL?? ?? ???? ?? ??? ???? ???, Oracle? Limit ??? ????? ?? ???? ???? ??? ? ?????. zend_db_select? ????? ???? ???? ?? Oracle?? ?? ?? ?? ?????? ???? ?? ??? ???? ?? select ?? ?? ??? ? ????.

??? ? ??? ???? ???? ???? ??? ????? ? ??? ??? ???? ? ??? ??? ?? ?? ??? ???? ??() ???? ??? ? ????.

<?php
// 首先,一個(gè)簡(jiǎn)單的 "LIMIT :count"
$select = $db->select();
$select->from(&#39;foo&#39;, &#39;*&#39;);
$select->order(&#39;id&#39;);
$select->limit(10);
//
// 在mysql/psotgreSql/SQLite,可以得到這樣的語(yǔ)句:
//
// SELECT * FROM foo
//   ORDER BY id ASC
//   LIMIT 10
//
// 但是在Microsoft SQL下,可以得到這樣的語(yǔ)句:
//
// SELECT TOP 10 * FROM FOO
//   ORDER BY id ASC
//
//
// 現(xiàn)在, 是更復(fù)雜的 "LIMIT :count OFFSET :offset"方法
$select = $db->select();
$select->from(&#39;foo&#39;, &#39;*&#39;);
$select->order(&#39;id&#39;);
$select->limit(10, 20);
//
// 在mysql/psotgreSql/SQLite,可以得到這樣的語(yǔ)句:
//
// SELECT * FROM foo
//   ORDER BY id ASC
//   LIMIT 10 OFFSET 20
//
// 但是在Microsoft SQL下,由于不支持偏移量功能,可以得到這樣sql語(yǔ)句:
//
// SELECT * FROM (
//   SELECT TOP 10 * FROM (
//     SELECT TOP 30 * FROM foo ORDER BY id DESC
//   ) ORDER BY id ASC
// )
//
// Zend_Db_Adapter 可以自動(dòng)的完成sql語(yǔ)句的動(dòng)態(tài)創(chuàng)建.
//
?>

LIMIT ??? ? ? ?? ? ??

Zend_db_select? ??? ?? ?? ??? ?????. ???? ?? "??? ?"? ??? ????, ??? ??? ?? ? ???? ???? ??? ?? ?? ????? ????? ?? ???.

<?php
// 構(gòu)造基礎(chǔ)的select方法:
$select = $db->select();
$select->from(&#39;foo&#39;, &#39;*&#39;);
$select->order(&#39;id&#39;);
// ... 限制到第三頁(yè),每頁(yè)包括10行數(shù)據(jù)
$select->limitPage(3, 10);
//
// 在MySQL/PostgreSQL/SQLite下, 可以得到:
//
// SELECT * FROM foo
//   ORDER BY id ASC
//   LIMIT 10 OFFSET 20
//
?>

? ??? Zend Framework ?????? ???? ?? ?? ??? PHP ?????? ??? ??? ????.

? ?? Zend Framework ?????? ?? ?? ??? ?? ?? ?? ???? PHP ??? ????? ??????!

? ????? ??
? ?? ??? ????? ???? ??? ??????, ???? ?????? ????. ? ???? ?? ???? ?? ??? ?? ????. ???? ??? ???? ???? ??? ?? admin@php.cn?? ?????.

? AI ??

Undresser.AI Undress

Undresser.AI Undress

???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover

AI Clothes Remover

???? ?? ???? ??? AI ?????.

Video Face Swap

Video Face Swap

??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

???

??? ??

???++7.3.1

???++7.3.1

???? ?? ?? ?? ???

SublimeText3 ??? ??

SublimeText3 ??? ??

??? ??, ???? ?? ????.

???? 13.0.1 ???

???? 13.0.1 ???

??? PHP ?? ?? ??

???? CS6

???? CS6

??? ? ?? ??

SublimeText3 Mac ??

SublimeText3 Mac ??

? ??? ?? ?? ?????(SublimeText3)

???

??? ??

??? ????
1601
29
PHP ????
1502
276
???