T
T
Taras Parashchuk2020-12-01 13:54:34
Laravel
Taras Parashchuk, 2020-12-01 13:54:34

What is the correct way to write such queries in Laravel?

$NUMBER = 496354 // Value obtained from CSV

vagprice::where('NUMBER', $NUMBER)->get(); // no results $records = 0
vagprice::where('NUMBER','496354')->get(); // found $records = 1
$NUMBER = (string) $NUMBER; // can convert to string ?
vagprice::where('NUMBER', $NUMBER)->get(); // no , not found ...

And in general
$NUMBER = 496354;
$NUMBER = strval($NUMBER);
vagprice::where('NUMBER', $NUMBER)->get(); // not found ...
$NUMBER = '496354'; // found

Thanks for helping. Read the documentation.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question