ssquare
1 year ago

Obtain result in object type and in single level

Posted 1 year ago by ssquare

My MSSQL procedure

CREATE PROCEDURE PROCEDURE_NAME
AS BEGIN
    SELECT COUNT(*) FROM users
END

Currently calling as $totalData = DB::select('EXEC PROCEDURE_NAME');

and getting result in

<pre>Array
(
    [0] => stdClass Object
        (
            [] => 200000
        )

)
</pre>

Instead of this how can I get 200000 directly in $totalData.

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