【发布时间】:2017-03-13 10:06:55
【问题描述】:
我有一个表格,它有 4 个数据..
现在我得到了 $_POST 上的数据。我想用他们的 API 把它放到谷歌电子表格中。但我太新手了,无法理解代码。
我只是实现了将 Google Client API 放到 codeigniter,但我不知道如何使用它。
我的代码是这样的..
$this->load->library('google');
$values = array(
array(
$this->input->post('name'),
$this->input->post('email'),
$this->input->post('reason'),
$this->input->post('mobile'),
date('Y-m-d')
)
);
$body = new Google_Service_Sheets_ValueRange(array(
'values' => $values
));
// $params = array(
// 'valueInputOption' => $valueInputOption
// );
$result = $this->google->spreadsheets_values->update("1gg8rHsKM3DhMaJVY-YexQyggAoq1pUCB5LpP5NFah8A", "Sheet1!A2:E2", $body, "");
我不知道这个参数的用途,所以我把它留空..
我运行这段代码并得到错误Message: Undefined property: Google::$spreadsheets_values
【问题讨论】:
标签: php codeigniter google-spreadsheet-api