I have litle problem with stored procedure when assign parameter value.
Am assigning value as a date '2016-05-01','2016-07-30'
Procedure work fine when i manual enter date like this:
CALL calculateSeasonPrice(3, '2016-05-01','2016-07-30')
success return array with data.
But problem is when i assign variables as arguments
$carId = 3;
$sDate = '2016-05-01';
// and
$eDate = '2016-07-30';
$price = $db->query("CALL calculateSeasonPrice({$carID},{$sDate},{$eDate})"); // problem
return empty array
Does i need to escape this two variales. I also try this and not work!
$price = $db->query("CALL calculateSeasonPrice(".$carID.",".$sDate.",".$eDate.")"); // This work
What i miss here?