Hi again Ian, just tried putting your code at top of page and removed the i8 code from insert behaviour values. Do I need to reference the fieldnames anywhere?
This still inserts 0000-00-00 into MySQL and displays it as 01-01-1970 on the details page? As you can probably tell I know nothing of php/mysql, normally work in SQL & asp which seems straightforward right now!
insert.php
<?php
if (isset($_POST["BT_Add"])) { // Trigger
if ($_POST['dateup'] != '') {
$_SESSION['var_update'] = formatUKDateMySQL($_POST['update']);
} else {
$_SESSION['var_update'] = Null;
}
if ($_POST['datedown'] != '') {
$_SESSION['var_downdate'] = formatUKDateMySQL($_POST['downdate']);
} else {
$_SESSION['var_downdate'] = Null;
}
}
?>
Example date field
<input type="text" name="StatusActiveDate" id="StatusActiveDate" value="Set Live Date" size="32" class="datepicker" /
details.php
[code]
<tr> <td><h6>Case Active:</h6></td>
<td><?php echo(date("d-m-Y", strtotime($row_WADAtblcases['StatusActiveDate']))); ?></td>
</tr>
<tr> <td><h6>Case Completed:</h6></td>
<td><?php echo(date("d-m-Y", strtotime($row_WADAtblcases['StatusCompDate']))); ?></td>
</tr>
<tr> <td><h6>Case NPW:</h6></td>
<td><?php echo(date("d-m-Y", strtotime($row_WADAtblcases['StatusNPWDate']))); ?></td>
</tr>
[code]