I am trying to compare a date stored as a variable against a row in mysql, this is where i am so far:
if(isset($_REQUEST['date1'])) {
$datum = $_REQUEST['date1'];
if($datum == "0000-00-00") {$datum = "";}
echo "Date: $datum";
echo "<br>";
} else { $datum = ""; }
$result = mysqli_query($link, " SELECT id, auditor, auditee, datum, department, func, proc, audit_type, copy_to, comments
FROM audit_data
WHERE
(
`auditor` LIKE '%$search_field%' OR
`auditee` LIKE '%$search_field%' OR
`department` LIKE '%$search_field%' OR
`func` LIKE '%$search_field%' OR
`proc` LIKE '%$search_field%' OR
`audit_type` LIKE '%$search_field%')
OR
(`id` = '$radio_id')
OR
(`datum` LIKE '%$datum%')
" )
OR
die(mysqli_error($link));
I am unable to get the query to return the row with the requested date.
$datum is stored as YYYY-MM-DD
datum
is the same.
I have tried everything! What the hell am I doing wrong??