milad
milad

Reputation: 123

php-rql selection command

I want to select some rows in users table which their ages are under 35. I wrote the code below but it doesn't work.

$cursor = r\table('users')->filter('age' < 35)->pluck(array('name','family','age'))->run($conn);

unfortunately, after execution the code above shows all the rows even the rows which are more than 35.

Upvotes: 0

Views: 37

Answers (1)

milad
milad

Reputation: 123

I have written the code below and it works truly

r\table('users')->filter(r\row('age')->lt(31))->pluck(array('name','family','age'))->run($conn);

Upvotes: 0

Related Questions