I have this Query as below:
$timeChk = "SELECT COUNT(id) as inTime, connections.* FROM connections WHERE (busID = '".$mid."' AND cusID = '".$tid."') OR (busID = '".$tid."' AND cusID = '".$mid."') AND FROM_UNIXTIME(timeIn,'%Y-%m-%d') = CURDATE() AND timeOut = '0'";
its always printing a row result.
Im suspecting that the COUNT(id) is causing the issue. This query should not return any results and
$timeChk['inTime'] should be zero (0) as per the database below:
in my database at this specific moment i do not have a table "timeOut" which is equalt to "0" || ''(blank)
What is the matter with this query?
How can i pull a $timeChk['inTime'] = 0
HERE IS DATABASE STRUCTURE:
id busID cusID timeIn timeOut
25 23 24 1593702664 1593703635
the goal of this table is to log someone in if the query above the $timeChk['inTime'] = 0; and if it returns $timeChk['inTime'] = 1; it will log the person out.
please help