问题
How can i use LIKE
operator in this sql statement using medoo framework?
Original SQL statement:
SELECT id,name FROM table WHERE name LIKE %'foo'%
medoo statement:
$data=$db->select('table',
['id','name'],
['AND' => ['name' => 'foo']
]
);
thanks for your help!
回答1:
Use like condition like this [~]
Refer the link
$data=$db->select('table',
['id','name'],
['AND' => ['name[~]' => 'foo']
]);
回答2:
$data = $db->select('table',['id','name'],['name[~]' => 'foo']);
来源:https://stackoverflow.com/questions/38461660/like-operator-in-medoo