echo block creation date

Permalink
Hello i have a custom block and i would like to show the creation date of the block.
i put at the db.xml
<field name="bDateAdded" type="T">
  <NOTNULL/>
  <DEFAULT value="0000-00-00 00:00:00"/>
</field>

and to the view.php
<div><?php  echo $bDateAdded; ?></div>


but doesn't work, someone give me some help.

 
ronyDdeveloper replied on at Permalink Reply
ronyDdeveloper
You have done coding in db as well as view, but missed out the controller part. You need to save the date into DB before displaying it into view. And this needs to be done in controller.php

Rony
dunget15 replied on at Permalink Reply
thanks for your help Rony,
i just put to the view.php
this
<?php 
$id = $bID;
$date = mysql_query("SELECT bDateAdded FROM blocks WHERE bID = $id");
$first = mysql_fetch_array( $date );
 echo $first[ 'bDateAdded' ];
?>

and it's ok