Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Slim + NotORM, select %Like%

Tags:

php

slim

I just started to use the Slim framework + NotORM_ and need to do the following:

SELECT * FROM Users WHERE name LIKE '%$value%'"

In Slim I can select the exactly matching rows using

$p = $db->Users()->where('name', $value) as $p)

I would appreciate if someone show me the right solution to my problem

like image 308
user3412802 Avatar asked Feb 17 '26 10:02

user3412802


2 Answers

You can provide the like keyword in your query with a wildcard, and add the % signs before and after your search term in PHP like this:

$p = $db->Users()->where('name like ?', "%$value%")
like image 157
nullability Avatar answered Feb 18 '26 22:02

nullability


where_like('DataFieldName','%'Query'%') 
like image 32
Syed Kashif Avatar answered Feb 18 '26 22:02

Syed Kashif