PDO and MySQL ‘between’

Don’t wrap the values with single quote.

$STH = $DBH->prepare("SELECT * FROM `table` WHERE `start_date` BETWEEN :start_date AND :end_date");

Leave a Comment