fluentpdo

How to stop FluentPDO incorrectly inferring a table name

别说谁变了你拦得住时间么 提交于 2019-12-12 05:15:51
问题 I have a table of users, and I want to be able to filter the table by the email column, so I can see all the users with 'gmail.com' accounts, for example. My current fpdo query looks like this: $filter_email = trim($_GET['email']); $fpdo->from('users') ->where('users.email LIKE "%' . $filter_email . '%"') ->fetchAll(); When I set $filter_email to a@b , everything works fine, and FluentPDO generates this SQL statement: SELECT users.* FROM users WHERE users.email LIKE "%a@b%" But if I search