在Zend Gdata中写入一行时调用非对象错误


Getting call to non-object error while writing a row in Zend Gdata

我正在尝试使用Zend GData向GoogleDocs电子表格添加一行的非常简单的过程。

只是为了确保我可以访问电子表格好的,我让它从电子表格中提取数据并打印出来,然后看看它是否可以写一行。

正如你所看到的,它读起来很好,但是当我试图写的时候,我得到了一个致命的错误。

array (0) => array ('firstname' => 'Stan','lastname' => 'Parker','dateofscreening' => '1.1.1111','peopleexpected' => '12','amountcharge ' => '12.15','dvdsent' => 'No',), 1 => array ('firstname' => 'Joe','lastname' => 'Smith','dateofscreening' => '2.2.222','peopleexpected' => '10','amountcharge ' => '10.15','dvdsent' => 'Yes',),)

致命错误:在非对象上调用成员函数insertRow()/home/stparker/public_html/happy/gdata.php第56行

代码如下:

 $query = new Zend_Gdata_Spreadsheets_DocumentQuery();
 $query->setSpreadsheetKey($key);
 $feed = $spreadSheetService->getWorksheetFeed($query);
 $entries = $feed->entries[0]->getContentsAsRows();
 echo "<hr><h3>Example 1: Get cell data</h3>";
 echo var_export($entries, true);

 $rowData = array 
 (
'firstname' => 'Big',
'lastname' => 'Smiley',
'dateofscreening' => '1.1.1111',
'peopleexpected' => '12',
'amountcharged' => '12.15',
'dvdsent' => 'No',
 );
  $spreadsheetService->insertRow($rowData,$key,'Sheet1');

帮忙吗?

变化:

$spreadsheetService->insertRow($rowData,$key,'Sheet1');

:

$spreadSheetService->insertRow($rowData,$key,'Sheet1');

您的大写字母在整个代码中不一致,例如,Sheet中的S