Difficulty obtaining query results -> PDO

Hello,

First, thanks in advance for any advice.

I’m able to query multiple rows from a single column name (See below from “print_r”).
What I would like to do is take the section “stdClass Object” and convert it & it’s sub-values into a multi-dimensional array but I can not seem to convert. Any ideas?

Thanks again,
D

/// output to screen from “print_r” ///

Product Object
(
[_db:Product:private] => DB Object
(
[_pdo:DB:private] => PDO Object
(
)
[_query:DB:private] => PDOStatement Object
(
[queryString] => SELECT * FROM products WHERE categoryID = ?
)
[_error:DB:private] =>
[_results:DB:private] => Array
(
[0] => stdClass Object
(
[productID] => 1
[categoryID] => ASM4
[productCode] => PC90
[productName] => Port & Company - Ultimate Crewneck Sweatshir
[listPrice] => 11.15
)
[1] => stdClass Object
(
[productID] => 6
[categoryID] => ASM4
[productCode] => NE1120
[productName] => New Era - Stretch Mesh Contrast Stitch Cap
[listPrice] => 11.59
)
)
[_count:DB:private] => 2
)

[_data:Product:private] => 
[_results:Product:private] => Array
    (
        [0] => stdClass Object
            (
                [productID] => 1
                [categoryID] => ASM4
                [productCode] => PC90
                [productName] => Port & Company - Ultimate Crewneck Sweatshir
                [listPrice] => 11.15
            )
        [1] => stdClass Object
            (
                [productID] => 6
                [categoryID] => ASM4
                [productCode] => NE1120
                [productName] => New Era - Stretch Mesh Contrast Stitch Cap
                [listPrice] => 11.59
            )
    )

)

You already have a multidimensional array, that is what print_r does, shows the values across the dimensions in the array that is passed to it.

Sponsor our Newsletter | Privacy Policy | Terms of Service