tags:

views:

26

answers:

1

From below array i want the value of "_sql" to be displayed or we can I want to echo the "_sql" value, so what should be the syntax to display it in PHP code?

JTableMenu Object
(
    [lft] => 
    [rgt] => 
    [home] => 
    [_tbl] => #__menu
    [_tbl_key] => id
    [_db] => JDatabaseMySQL Object
        (
            [name] => mysql
            [_nullDate] => 0000-00-00 00:00:00
            [_nameQuote] => `
            [_sql] => INSERT INTO `jos_menu` ( `id`,`menutype`,`name`,`alias`,`link`,`type`,`published`,`componentid`,`parent`,`ordering`,`checked_out`,`checked_out_time`,`brow............
            [_errorNum] => 0
         )
)

In the code the above array is stored in $row, so i have written an echo statement to display the required value like this: echo $row['_db]['_sql']; please suggest where and why I am getting wrong Why I cannot get the value in "_sql" index?

+1  A: 

I got the Solution I did this

echo $row->_db->_sql;

And I got the output... Thanks Pranav

OM The Eternity
it would be cleaner OOP to have getter methods for this.
Gordon