I try to write a variable into the field in MySQL. But i dont have result.
This is my code. Who can help me?
This is my code. Who can help me?
$current_time = & JFactory::getDate();
$time = $current_time->toMySql();
echo $time; //give correct result
$db =& JFactory::getDBO();
$query = "
UPDATE ".$db->nameQuote('jos_chronoforms_newdata')."
SET ".$db->nameQuote('approvaltime')." = $time
//it's OK if ---- SET ".$db->nameQuote('approvaltime')." = '123456789'
WHERE ".$db->nameQuote('cf_id')." =$index
";
$db->setQuery($query);
$db->query();