I’m trying a very simple process of adding a row to a GoogleDocs spreadsheet using Zend GData.
Just to make sure I can access the spreadsheet okay, I’m having it pull the data from the spreadsheet and print it out, then see if it can write a row.
As you can see, it reads just fine, but I get a fatal error when it tries to write.
array ( 0 => array (
‘firstname’ => ‘Stan’,
‘lastname’ => ‘Parker’,
‘dateofscreening’ => ‘1.1.1111’,
‘peopleexpected’ => ’12’,
‘amountcharged’ => ‘12.15’,
‘dvdsent’ => ‘No’, ), 1 => array (
‘firstname’ => ‘Joe’,
‘lastname’ => ‘Smith’,
‘dateofscreening’ => ‘2.2.222’,
‘peopleexpected’ => ’10’,
‘amountcharged’ => ‘10.15’,
‘dvdsent’ => ‘Yes’, ), )Fatal error: Call to a member function insertRow() on a non-object in
/home/stparker/public_html/happy/gdata.php on line 56
Here’s the code:
$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');
Any help?
Change:
To:
Your capitalization wasn’t consistent throughout the code, e.g.,
SinSheet.