-1

我收到了带有 where 条件的 sql 问题:

$select->where('(users.user_fname LIKE (?) )','%'.$first.'%');

如何放入它 OR 条件,使其看起来像:

$select->where('(users.user_fname LIKE (?) )','%'.$first.'%');
OR
$select->where('(users.user_fname LIKE (?) )','%'.$last.'%');
4

1 回答 1

1

http://framework.zend.com/manual/1.12/en/zend.db.select.html

$select
    ->where('(users.user_fname LIKE "%?%")', $first)
    ->orWhere('(users.user_fname LIKE "%?%")', $last)
;
于 2012-10-24T20:47:09.877 回答