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 -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -