$users = new DB();
$users->select('username', 'email');
$users->from('users');
$users->execute();
$users->as_array();
$users = DB::select('*')
->from('users')
//->where('user_id', '=', 1)
//->join('groups', 'LEFT')
//->on('group_id', '=', 'group.id)
//->or_where('user_id', '=', 'me')
//->limit(Pagination::$per_page)
//->offset(Pagination::$offset)
//->order_by('user_id', 'ASC')
->execute()
->as_object(); // as_array() is the default setting
I will amend the post thanks.
The syntax for or_where is or_where($column, $op, $value)
One way of achieving what you want is to put the db call in a for loop.$num = sizeof($keywords);
for($i=0; $i < $num; $i++)
{
$result = DB::select('title')
->from('articles')
->or_where('your_field_name', '=', $keyword[$i])
->as_object()
->execute();
// Do some processing with the result
}
It looks like you're new here. If you want to get involved, click one of these buttons!