I am trying to display a form ONLY if the current row is empty.. Currently the row in my DB is NOT empty. It has a date in it.. 2/10/16 it is set as a VARCHAR though. Anyways, When I use the following.. It still shows me the form even though it shouldnt because the row is NOT empty..
Below is the code
order = $_GET['uid'];
$stmt=$this->db->prepare("SELECT * FROM orders WHERE order_num = :order");
$stmt->execute(array(":order"=>$order));
$row=$stmt->fetch(PDO::FETCH_ASSOC);
if (empty($row['giventoatpdate'])) {
echo
"
<form name='atpdate' method='POST'>
Date Sent to clown?
<br>
<input type='text' name='update'>
<br>
<input type='submit' name='giventoatpdate'>
</form>
";
}
All variable names are correct and spelled correctly.
The select statement is working aswell, Already tested.. I feel it has to do with empty and the data in teh db being a date. 2/10/16