PHP MySQL Date Update EU
This is an alternate version of my upDATE extension which formats dates in the YYYY-DD-MM format used in the european nations.
Shortly after starting to use the PHP/MySQL Server Model in Dreamweaver MX, it occurred to me that the DATE type in the insert/update behaviors did not work properly in some cases. We were constantly adding code to the behavior to make it work correctly. This extension updates the edml file responsible for setting the DATE type and makes sure it is in the YYYY-DD-MM format.
v1.1 includes an addition for time and datetime as requested by Kurt Mallery. Although we have not added these to the Insert/Update dialogs yet, you can use them by changing the code by hand.
Overview
UI Access
This update is automatically added to the Insert/Update Record Server Behaviors of the PHP/MySQL Server Model.
Note: If you have a page that already has an Insert or Update behavior on it, you may have to manually remove an old GetSQLValueString function. You can do this by:
- Remove the Insert/Update server behavior
- Search the code for "function GetSQLValueString"
- Remove the function from your code
- Re-Add the Insert/Update server behavior
Requirements
Type: Server Behavior
Product: Dreamweaver MX, Dreamweaver MX 2004
Server Model: PHP MySQL
Greg is the President & Owner of Stretched Out Software Inc, a flourishing web & multimedia programming company located in Jacksonville, FL USA. With a background in programming and a degree in Computer Animation, the internet has become my playground.
Unless otherwise noted, all of Greg's extensions are Mac & PC compatible!
See All Postings From Greg Olone >>
Reviews
UE to us tweak
For those of you that had problem to convert UE date to US date, adding that code to the extension code did help me :
implode('-',array_reverse(split('[/]','20/10/2003')));
here is how it looks in the code
Extension code:
$theValue = ($theValue != "") ? "'" . date("Y-d-m",strtotime($theValue)) . "'" : "NULL";
Modified code:
$theValue = ($theValue != "") ? "'" . date(implode('-',array_reverse(split('[/]',$theValue)))) . "'" : "NULL";
Hope it helps
You must me logged in to write a review.