Reputation: 13
PHP also made my query in laravel can not.
this my PDO code.
$query2 = $db->query("SELECT * FROM veriler WHERE masraf_kodu='$hesap_kodu' AND tarih BETWEEN '$tarih1' AND '$tarih2'", PDO::FETCH_ASSOC);
how can laravel 5 controller query ?
masraf_kodu data table, hesap kodu plans database
Upvotes: 1
Views: 30
Reputation: 163798
If you're using Query Builder, try whereBetween()
:
$data = DB::table('veriler')
->where('masraf_kodu', $hesap_kodu)
->whereBetween('tarih', [$tarih1, $tarih2])
->get();
Upvotes: 1