1 month ago

Raw SQL query to array

Posted 1 month ago by mleontenko

I'm using a raw SQL query that selects some ids from database. It looks like this:

$query = DB::select('SELECT pr.id_obrasca_prethodne 
        FROM public."prethodneNacionalneProcjene" AS pr 
        JOIN public."obrasciProcjeneVrste" AS ob ON pr.id_obrasca = WHERE ob.status LIKE \'Prihvaćen\'');

If I output the $query variable now, I get:


I need to convert the result of query to PHP array so it contains only numbers (8, 28, ...). How can I do this?

Please sign in or create an account to participate in this conversation.