I am trying to get the days between 2 dates, but I am only getting errors. I tried searching it but non of the things really helped me, I am hoping you guys can help a boy out right here.
The error I get with this code:
Fatal error: Uncaught PDOException: SQLSTATE[42000]: Syntax error or access violation: 1582 Incorrect parameter count in the call to native function 'DATEDIFF' in C:\xampp\htdocs\Rent-a-Car\pages\medewerkers.php:197 Stack trace: #0 C:\xampp\htdocs\Rent-a-Car\pages\medewerkers.php(197): PDO->query('SELECT DATEDIFF...') #1 {main} thrown in C:\xampp\htdocs\Rent-a-Car\pages\medewerkers.php on line 197
my code to display it several times in the table
The sql command that is used:
$sql1 = "SELECT * FROM factuur
LEFT JOIN factuurregel ON factuur.Factuurnummer = factuurregel.Factuurnummer
LEFT JOIN gebruiker ON factuur.Klantcode = gebruiker.Klantcode
LEFT JOIN auto ON factuur.Kenteken = auto.Kenteken";
$sql2 = "SELECT DATEDIFF (day, Begindatum, Einddatum) AS Tijd from factuurregel;";