Hi all,
I have 2 fields in a table
field 1 = accomarival TYPE timestamp
field 2 = accomdepart TYPE timestamp
I have a MySQL query:
SELECT * , DATE_FORMAT(departuredate, '%d/%m/%Y') as d_date, DATE_FORMAT(accomarival, '%d/%m/%Y') as a_date, DATE_FORMAT(accomdepartdate, '%d/%m/%Y') as ac_date, DATE_FORMAT(profiledate, '%d/%m/%Y') as p_date
FROM amember_baggagemembers
WHERE member_id = colname
What I am trying t do is run an if statement which will look at todays date, and if it is in between "a_date" and "ac_date" display X, and if not in between "a_date" and "ac_date", display Y.
This is what I have
if ($row_owners['a_date'] >= date("d, m, Y") && $row_owners['ac_date'] <= date("d, m, Y")) {
echo $row_owners['houseno'];
}
else
{
echo $row_owners['accom1'];
}
Am I doing this corectly.