0
查詢我有這個疑問:搜索在CakePHP 1.2
$conditions = array(
'editore LIKE' => "%$e%",
'titolo LIKE' => "%$t%"
);
if (isset($autore_diviso))
$conditions[] = array('autori LIKE ? AND ?' => array("%$autore1%","%$autore2%"));
else
$conditions[]=array('autori LIKE' => "%$a%");
if (!$anno&&!$anno2) // I HAVE TO CHANGE THIS - if the user does not insert any year
$conditions=$conditions;
else {
if (!$anno)
$conditions[] = array('anno <=' => "$anno2");
if (!$anno2)
$conditions[] = array('anno >=' => "$anno");
}
if ($anno&&$anno2)
$conditions[] = array('anno BETWEEN ? AND ?' => array($anno,$anno2));
凡阿魯平均年,EDITORE意味着出版商和TITOLO意味着稱號。
這不是正確的2個作者的搜索工作。
如果我調試$條件,我有,例如:
Array (
[editore LIKE] => %%
[titolo LIKE] => %%
[0] => Array
(
[autori LIKE ? AND ?] => Array
(
[0] => %massi%
[1] => %palu%
)
))
但結果是空的。
我越來越接近,但它不工作的搜索2名作者,我編輯的問題。 – Ettore 2013-02-12 08:33:17