1

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

1

1 Answer 1

1

If you're using Query Builder, try whereBetween():

$data = DB::table('veriler')
             ->where('masraf_kodu', $hesap_kodu)
             ->whereBetween('tarih', [$tarih1, $tarih2])
             ->get();
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.