Using ew_Execute() to update a field in another table

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
sprocker
User
Posts: 38

Using ew_Execute() to update a field in another table

Post by sprocker »

I have a custom view to combine two tables.

The field I need yo update is in the secondary table so I need to use something like this to update it

$crd = $POST['x_ClientReturnDate']
$plitid = $
POST['x_ID1'];


$MyResult = ew_Execute("UPDATE Customers SET ClientReturnDate='$crd' WHERE ID='$plitid'");


I am using dd/mm/yyyy to display the date but when I run the update it is showing 01/01/1970 in the database.

Any help appreciated


sprocker
User
Posts: 38

Post by sprocker »

$crdpost = $POST['x_ClientReturnDate'] ;
$crd = ew_HtmlEncode(ew_FormatDateTime($crdpost, 7));
$crd = date('Y/m/d', strtotime($crd)); // outputs 2010-06-16
$plitid = $
POST['x_ID1'];
$MyResult = ew_Execute("UPDATE Customers SET ClientReturnDate='$crd' WHERE ID='$plitid'");

This owrked in case anyone needs it!


Post Reply