Re: [RFC] Name issue - is_literal/is_trusted
| From: | Craig Francis | Date: | Thu, 24 Jun 2021 10:16:08 +0000 |
| Subject: | Re: [RFC] Name issue - is_literal/is_trusted | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-115106@lists.php.net to get a copy of this message | ||
On Thu, 24 Jun 2021 at 10:55, Stephen Reay <php-lists@koalephant.com> wrote:
> but still I have to keep asking: Why integers at all?
>
While I'm not a fan of this approach, there is a lot of existing code and
tutorials that use:
$sql = 'WHERE id IN (' . implode(',', array_map('intval', $ids)) .
')';
$sql = sprintf('SELECT * FROM table WHERE id = %d;', intval($id));
Craig