makeDateTime and DoFormatCurrency php functions

Let me start by saying that I am very new to PHP and DBs. I am taking a lynda course called “Dreamweaver CS4 Dynamic Development”. I have been doing static websites and wanted to take it a step further. Here is my problem.

Following along with the course we are creating a form that will display existing data in form controls. Early in the course they told me to go to adobe exchange and download the “FX_PHP_DateTFormats.mxp” and “MX744392_PHPServerFormats.mxp” ext for php functions in Dreamweaver CS4. I did and installed them correctly.

Now we are at a part where we are formatting output from the db. The initial code looks like this:

“<input name=“pubdate” type=“text” id=“pubdate” value=”<?php echo $row_rsTitle[‘pubdate’]; ?>" />"

and displays an output that looks like this:

“2003-01-05 00:00:00”

It asks me to go through the menus to select and create this code under the menu label 0f “Date - 01/05/2004”:

“<input name=“pubdate” type=“text” id=“pubdate” value=”<?php echo makeDateTime($row_rsTitle[‘pubdate’], ‘m/d/Y’); ?>" />"

Now it’s suppose to output the 01/05/2004 format but instead I get the following error:

“Fatal error: Call to undefined function makeDateTime() in C:\wamp\www\dwwithphp\ itleupdateform.php on line 127”

Line 127 is this line:

“<input name=“pubdate” type=“text” id=“pubdate” value=”<?php echo makeDateTime($row_rsTitle[‘pubdate’], ‘m/d/Y’); ?>" />"

Now I have been googling this for hours. I have found some people that say that the makeDateTime php function doesn’t exist and others that show how to use it but not with a variable being output from the db. I have tried researching date function with php but none of the sites that i found show how to couple it with a db output.

I am getting a similar error with DoFormatCurrency for my price field.

Any idea?

I’m not sure how Dreamweaver handles include calls of .mxp files, but the file that defines the function makeDateTime() is not being properly included in your PHP script before you’re trying to call it.

To display the date in m/d/Y format without calling makeDateTime() see below. You would be better off reading the PHP manual entry for date() and giving it the format you want the timestamp to print as.

<input name="pubdate" type="text" id="pubdate" value="<?php echo date('m/d/Y', strtotime($row_rsTitle['pubdate'])); ?>" />