如何使用medoo框架在此sql语句中使用LIKE
运算符?
原始SQL声明:
SELECT id,name FROM table WHERE name LIKE %'foo'%
medoo声明:
$data=$db->select('table',
['id','name'],
['AND' => ['name' => 'foo']
]
);
感谢您的帮助!
答案 0 :(得分:4)
使用类似[~]
Refer the link
$data=$db->select('table',
['id','name'],
['AND' => ['name[~]' => 'foo']
]);
答案 1 :(得分:2)
$data = $db->select('table',['id','name'],['name[~]' => 'foo']);