Skip to content

Commit e3cf074

Browse files
committed
wip
1 parent c720e78 commit e3cf074

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

queries.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,9 @@ You may also pass an array of conditions to the `where` function. Each element o
479479
> [!WARNING]
480480
> PDO does not support binding column names. Therefore, you should never allow user input to dictate the column names referenced by your queries, including "order by" columns.
481481
482+
> [!WARNING]
483+
> MySQL and MariaDB automatically typecast strings to integers in string-number comparisons. In this process, non-numeric strings are converted to `0`, which can lead to unexpected results. For example, if your table has a `secret` column with a value of `aaa` and you run `User::where('secret', 0)`, that row will be returned. To avoid this, ensure all values are typecast to their appropriate types before using them in queries.
484+
482485
<a name="or-where-clauses"></a>
483486
### Or Where Clauses
484487

0 commit comments

Comments
 (0)