|
|
@@ -1,6 +1,6 @@
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
<!-- Reviewed: no -->
|
|
|
-<!-- EN-Revision: 15617 -->
|
|
|
+<!-- EN-Revision: 15637 -->
|
|
|
<sect1 id="zend.db.table">
|
|
|
|
|
|
<title>Zend_Db_Table</title>
|
|
|
@@ -1121,8 +1121,10 @@ $rows = $table->fetchAll($select);
|
|
|
<programlisting language="php"><![CDATA[
|
|
|
$table = new Bugs();
|
|
|
|
|
|
-$select = $table->select();
|
|
|
-$select->where('bug_status = ?', 'NEW')
|
|
|
+// join する際には、from 部を指定して取得するのが重要です
|
|
|
+$select = $table->select(Zend_Db_Table::SELECT_WITH_FROM_PART);
|
|
|
+$select->setIntegrityCheck(false)
|
|
|
+ ->where('bug_status = ?', 'NEW')
|
|
|
->join('accounts', 'accounts.account_name = bugs.reported_by')
|
|
|
->where('accounts.account_name = ?', 'Bob');
|
|
|
|
|
|
@@ -1152,7 +1154,7 @@ $rows = $table->fetchAll($select);
|
|
|
<programlisting><![CDATA[
|
|
|
$table = new Bugs();
|
|
|
|
|
|
-$select = $table->select()->setIntegrityCheck(false);
|
|
|
+$select = $table->select(Zend_Db_Table::SELECT_WITH_FROM_PART)->setIntegrityCheck(false);
|
|
|
$select->where('bug_status = ?', 'NEW')
|
|
|
->join('accounts',
|
|
|
'accounts.account_name = bugs.reported_by',
|