Is there a way to specify the Ravel query rebuild SQL bind variable?

Asked 2 years ago, Updated 2 years ago, 39 views

ListArray=[1,2,3];
Stack::where('columnA', $ListArray) - > toSQL;

I checked the contents of SQL as and found that where(`columnA`=?).

I'd like to check if where works for the elements of the array, but is there a good way?

laravel

2022-09-29 20:30

1 Answers

If you use getBindings instead of toSql as shown below, you will be able to confirm the binding.
"Also, it may be a code transfer error, but it seems that ""$"" before ""ListArray"" is missing."

$ListArray=[1,2,3];
Stack::where('columnA', $ListArray)->getBindings();


2022-09-29 20:30

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.