Jump to content

bowker

New Members
  • Posts

    2
  • Joined

  • Last visited

bowker's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I have tried a couple of different ways using isnull but I think the syntax is wrong or I am putting it in the wrong place.
  2. Hi hope someone can help, I have a field called DateBooked which by default is NULL. As expected strtotime brings back 01/01/1970 I am using DateBooked as one of the fields on an email that is being sent automatically. I need an IF statement to check if DateBooked is NULL and if so return blank and if not return the date as d-m-y. The code below runs fine to insert the info in the email, I'm just not sure where to put the IF to check DateBooked is NULL or not. function getTrainingHtml($data) { $training = ''; foreach ($data as $value) { $training .= ' <tr style="line-height: 25px;"> <td width="15%" style="border-bottom: 1px solid #ddd;">'.$value['FirstName'].' '.$value['LastName'].'</td> <td width="40%" style="border-bottom: 1px solid #ddd;">'.$value['CourseName'].'</td> <td width="10%" style="border-bottom: 1px solid #ddd;">'.date('d-m-Y' , strtotime ($value['ExpiryDate'])).'</td> <td width="10%" style="border-bottom: 1px solid #ddd;">'.date('d-m-Y' , strtotime ($value['DateBooked'])).'</td> <td width="25%" style="border-bottom: 1px solid #ddd;">'.$value['Notes'].'</td> </tr>'; } return $training; } function executeQuery($query)
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.