Skip to content
Advertisement

Issues converting stdClass to array

I have converted one of my websites to use PDO database queries. All the queries are working perfectly except one and I have spent all day trying to solve this problem and nothing is working for me so as a last resort I am asking for some advice here.

This is the function I am having the problem with

JavaScript

It returns a single row even though there are many others and as an object

JavaScript

I need this to be returned as an array and to get all the rows with profileId = :profileId

I have tried everything I can find online and have had no success at all.

Advertisement

Answer

Try this code

JavaScript

If in doubt, check out the URL below:

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement