How to push array in stdClass array in php -


I have an array that is getting from my database, for example:

  $ Db_record = $ this- & gt; Search_model- & gt; Search_app (); Forex Currency ($ db_record as $ db_data) {echo $ db_data- & gt; Phone_number; }  

In the above example, I am able to fetch the record without any issue, but I want to add other data later in $ db_data . foreach ($ db_record as $ db_data) {echo $ db_data- & gt; Phone_number; $ Db_data [] ['NEW_VALUE'] = 'Pacific'; }

but $ db_data [] ['new_value'] = 'Pacific'; throwing error down

  can not use the object  

in the form of the array type stdClass It would be great that someone called me 5 hours Can help in the form of straglings more than time.

Try $ db_data-> New_value = 'prashant';


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

asp.net mvc - How to attach sql database to a javascript graph -

c# - How to know the number of Threads created and limit the Tasks accordingly -