medoo 中的 LIKE 运算符
LIKE operator in medoo
如何使用 medoo 框架在此 sql 语句中使用 LIKE
运算符?
原SQL声明:
SELECT id,name FROM table WHERE name LIKE %'foo'%
medoo 声明:
$data=$db->select('table',
['id','name'],
['AND' => ['name' => 'foo']
]
);
感谢您的帮助!
像这样使用条件 [~]
Refer the link
$data=$db->select('table',
['id','name'],
['AND' => ['name[~]' => 'foo']
]);
$data = $db->select('table',['id','name'],['name[~]' => 'foo']);
如何使用 medoo 框架在此 sql 语句中使用 LIKE
运算符?
原SQL声明:
SELECT id,name FROM table WHERE name LIKE %'foo'%
medoo 声明:
$data=$db->select('table',
['id','name'],
['AND' => ['name' => 'foo']
]
);
感谢您的帮助!
像这样使用条件 [~]
Refer the link
$data=$db->select('table',
['id','name'],
['AND' => ['name[~]' => 'foo']
]);
$data = $db->select('table',['id','name'],['name[~]' => 'foo']);