如何使用rails应用程序配置roundcube邮件服务? 写下production.rb所需的代码,我正在尝试以下代码:
$fields = array('first_name', 'last_name', 'email', 'job', 'country', 'city');
$inputParameters = array();
foreach ($fields as $field) {
// don't forget to validate the fields values from $_POST
if (!empty($_POST[$field])) {
$inputParameters[$field] = '%' . $_POST[$field] . '%';
}
}
$where = implode(' OR ', array_map(function($item) {
return "`$item` LIKE :$item";
}, array_keys($inputParameters)));
$search = $db->prepare("SELECT `id`, `name` FROM `users` WHERE $where");
$search->execute($inputParameters);
foreach ($search->fetchAll(PDO::FETCH_ASSOC) as $row) {
var_dump($row);
}