PHP plugin code

jo-ka

Member
Hello.

I'm trying to input in a external table field, the date/time when the form record is saved. But I can't use the default date/time element for the form, as the date must only be saved on the external table under some conditions set on the PHP code.

So, I'm trying to use this:

$query->clear()->select('Now ()');
$db->setQuery($query);
$sodate = $db->loadResult();

$query->clear()
->insert('serviceorder')
->set('CreationDate = ' .$db->quote($sodate));
$db->setQuery($query);
$db->execute();

I receive an error message like this:
Err] 1630 - FUNCTION xxx.Now does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual

How can I solve this? I assume I don't need to create the variable $sodate, but I can't find the correct code.

Can you help please?
 
Or just ...

Code:
$query->clear()
->insert('serviceorder')
->set('CreationDate = NOW()');
$db->setQuery($query);
$db->execute();

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top