Answer the question
In order to leave comments, you need to log in
What is wrong in Laravel request code?
Hello.
There is a code
$code = 'TEXT'
DB::table('coupons')
->where('code', $code)
->select('coupons.active', 'coupons.created_at')
->toSql();
select `coupons`.`active`, `coupons`.`created_at` from `coupons` where `code` = ?
Answer the question
In order to leave comments, you need to log in
Everything is correct. It uses PDO with placeholders ( prepared queries ).
Instead of ? TEXT will be substituted when the request goes to Mysql.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question