ramiwahdan Posted March 16, 2020 Share Posted March 16, 2020 hi, i have pdo with select statement and trying to put 3 where clauses, why it is not working? code: $conn = new PDO("mysql:host=$servername;dbname=timeclock", $username, $password); // set the PDO error mode to exception $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $res = $conn->query("SELECT oracleid , name , des , clockingindate as clockin , clockingoutdate as clockout , timediff(clockingoutdate, clockingindate) as duration , total FROM attendance_records JOIN ( SELECT oracleid , sec_to_time(sum(timestampdiff(SECOND, clockingindate, clockingoutdate))) as total FROM attendance_records where isdone =-1 GROUP BY oracleid ) tots USING (oracleid) where isdone =-1, DATE(ClockingOutDate) >= $sdate1, DATE(ClockingOutDate) <= $edate1 ORDER BY oracleid, clockingindate "); 3rd line from last i have 3 clauses, please advise Quote Link to comment https://forums.phpfreaks.com/topic/310301-multiple-where-clauses-in-pdo/ Share on other sites More sharing options...
requinix Posted March 16, 2020 Share Posted March 16, 2020 WHERE And please ask your database questions in the appropriate database forum. Quote Link to comment https://forums.phpfreaks.com/topic/310301-multiple-where-clauses-in-pdo/#findComment-1575504 Share on other sites More sharing options...
ramiwahdan Posted March 16, 2020 Author Share Posted March 16, 2020 25 minutes ago, requinix said: WHERE And please ask your database questions in the appropriate database forum. Sure sorry about that but question is, apart of where being in caps, the rest is ok with comma or I need for each to include where in caps? Quote Link to comment https://forums.phpfreaks.com/topic/310301-multiple-where-clauses-in-pdo/#findComment-1575505 Share on other sites More sharing options...
requinix Posted March 16, 2020 Share Posted March 16, 2020 2 minutes ago, ramiwahdan said: apart of where being in caps, the rest is ok with comma or I need for each to include where in caps? Uppercase or lowercase does not matter. Read the rest of the page. It tells you how to use a WHERE clause. Correctly. Quote Link to comment https://forums.phpfreaks.com/topic/310301-multiple-where-clauses-in-pdo/#findComment-1575507 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.