phalapi框架where条件查询

// WHERE name = 'dogstar' AND age = 18
$user->where(array('name' => 'dogstar', 'age' => 18)) // WHERE name = 'dogstar' OR age = 18
$user->or('name', 'dogstar')->or('age', 18) // WHERE ((name = ? OR id = ?)) AND (note = ?) -- 'dogstar', '1', 'xxx'
#实现方式1:使用and拼接
$user->where('(name = ? OR id = ?)', 'dogstar', '1')->and('note = ?', 'xxx')
#实现方式2:只使用where,不用数组传参
$user->where('(name = ? OR id = ?) AND note = ?', 'dogstar', '1', 'xxx')
#实现方式3:只使用where,用下标为顺序数字的数组传参
$user->where('(name = ? OR id = ?) AND note = ?', array('dogstar', '1', 'xxx'))
#实现方式4:只使用where,用下标为标识符的数组传参
$user->where('(name = :name OR id = :id) AND note = :note', array(':name' => 'dogstar', ':id' => '1', ':note' => 'xxx'))
上一篇:How to Get Vertical Line from Point and Line


下一篇:OpenGL ES2学习笔记(6)-- Line Strip和Line Loop