print_r($object) の結果は次のとおりです。
Array
(
[0] => stdClass Object
(
[title] => Test procedures in watermelons
[nid] => 494
[type] => chsmanuscript
)
[1] => stdClass Object
(
[title] => How to eat cookies
[nid] => 520
[type] => chsmanuscript
)
)
このオブジェクト配列に 3 番目のオブジェクト項目を手動で追加するにはどうすればよいですか? 以下を試しましたが、うまくいきません。
$object[2]->title = 'test';
$object[2]->nid = '999';
$object[2]->type = 'chsmanuscript'
エラーは次のとおりです: 致命的なエラー: DatabaseStatementBase 型のオブジェクトを配列として使用できません