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 but 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. $ db_data .
foreach ($ db_record as $ db_data) {echo $ db_data- & gt; Phone_number; $ Db_data [] ['NEW_VALUE'] = 'Pacific'; }
$ db_data [] ['new_value'] = 'Pacific';
throwing error down
can not use the object
Try $ db_data-> New_value = 'prashant';
Comments
Post a Comment