Hi,
This code sometimes insert new empty rows, what i want is to update
existing row if found. please let me know asap.
function play($tag="")
{
$this->layout = "blank";
$data = $this->Audio->find("Audio.seo_url = '$tag'");
if (empty($data))
$this->redirect('/errors/error404');
$arr = array();
$arr["Audio"]["id"] = $data["Audio"]["id"];
$arr["Audio"]["hits"] = $data["Audio"]["hits"] + 1;
$this->Audio->save($arr);
$this->set('url',$this->Utility->translateURI($data["Audio"]
["download_url"]));
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---