When switching to Laravel, SQL queries are changed.
From this:
$sql = "SELECT * FROM table";
$result = mysqli_query($db, $sql);
to:
$sql = 'SELECT * FROM table';
$result = DB::select($sql);
(I want to use SQL raw queries in LARAVEL to make rewriting the code easier https://laravel.com/docs/7.x/database#running-queries)
Sorry if this question is obvious, but I'm a beginner and don't understand the other answers I've found. Now what to add to the new code, so the old $result and new $result behave the same?
Because new $result is an array, right? I need to have the new $result behave like the old $result to change the code easily.
Optional: do you know which topics I need to learn to understand this better myself?