im using google spreadsheets as means of recording timestamp. im using farinspace googlespreadsheet php and zendgdata. i can add new rows with no problem , but i just found myself in a problem...
what happens if i want to updateRow, where column name is equal to todays day,,,in other words i want to update the timestamp today, being monday,,,and when i do, all rows with value Monday on the Day column gets timestamp...
i just need to do it on one row, and keep track of what row i am so i can consecutively update next days... i hope all that makes sense... if it doesnt please let me know so i can explain my self better.
include_once("Google_Spreadsheet.php");
$u = "dude@gmail.com";
$p = "dudepass";
$ss = new Google_Spreadsheet($u,$p);
$ss->useSpreadsheet($id_employee);
$id = date('l'); //this gives me todays day name
$row = array
(
"In" => date("H:i")
); // using this in column In, i will post date
if ($ss->updateRow($row,"day=".$id))
{
echo "Updated";
}else{
echo "Some Error";
}
that above is the basic function of the link above of farinspace sheet, the updateRow, loops through all rows that have the "monday" name and timestamps all of them. i need to know how can i prevent that...saying for example, today being monday update only "In" and "Out" columns of row monday,,, not all rows having monday in it
function updateRow($row,$search)
{
if ($this->client instanceof Zend_Gdata_Spreadsheets AND $search)
{
$feed = $this->findRows($search);
if ($feed->entries)
{
foreach($feed->entries as $entry)
{
if ($entry instanceof Zend_Gdata_Spreadsheets_ListEntry)
{
$update_row = array();
$customRow = $entry->getCustom();
foreach ($customRow as $customCol)
{
$update_row[$customCol->getColumnName()] = $customCol->getText();
}
// overwrite with new values
foreach ($row as $k => $v)
{
$update_row[$this->cleanKey($k)] = $v;
}
// update row data, then save
$entry = $this->client->updateRow($entry,$update_row);
if ( ! ($entry instanceof Zend_Gdata_Spreadsheets_ListEntry)) return FALSE;
}
}
return TRUE;
}
}
that is the updateRow function