That's not how you add elements to arrays in PHP. Also, there's no need to use explicit AND
, that's the default. It's needed only if there would otherwise be multiple identical array keys.
$conditions = array(
'autori LIKE ? AND ?' => array("%$autore1%","%$autore2%"), 'editore LIKE' => "%$e%",
'titolo LIKE' => "%$t%"
);
if (!$anno)
$conditions[] = array('anno <=' => "$anno2");
if (!$anno2)
$conditions[] = array('anno >=' => "$anno");
if ($anno&&$anno2)
$conditions[] = array('anno BETWEEN ? AND ?' => array($anno,$anno2));