Formatting date

Larion476 18 Jul, 2011
I have a form with a DATETIME field, I am trying to extract the date, in the body section I put
<td><?php echo substr({evdate},0,10); ?></td>


I get this message:
Parse error: syntax error, unexpected '{', expecting ')' in /home/hilair/public_html/chef/components/com_chronoconnectivity/libraries/connection.php(303) : eval()'d code on line 4.

What am I doing wrong?
GreyHead 18 Jul, 2011
Hi Larion476,

You can use the {input_name} syntax in PHP. Use $MyRow->input_name instead.
<td><?php echo substr($MyRow->evdate, 0, 10); ?></td>

Bob
wanacom 20 Jul, 2011
Hello

Can you tell me how I can have the variable $MyRow ?

Thanks

++ Gilles
GreyHead 20 Jul, 2011
Hi Gilles,

Sorry, I don't understand your question? ChronoForms creates $MyRow for you.

Bob
wanacom 20 Jul, 2011
OK Thanks Bob !
This topic is locked and no more replies can be posted.