pdo select statement returning no rows

sheeple_rancher

New Member
I am making a simple select from mySQL using PHP. I am doing something wrong that I can't seem to track down.Here's my statement:\[code\]$storyTitle = $_GET['title'];$storyDate = urldecode($_GET['date']);$SQL = "SELECT * FROM tblContent WHERE REPLACE(contentTitle,' ' , '-') = :storyTitle AND date(publishDate) = date(:storyDate)";$conn = new PDO("mysql:host=$dbhost;dbname=$dbname",$dbuser,$dbpass);$q = $conn->prepare($SQL);$q->execute(array(':storyTitle' => $storyTitle, ':storyDate' => $storyDate)); while($r = $q->fetch()){ echo $SQL; };\[/code\]This throws no errors and gives no rows.If I replace the identifiers :storyTitle and :storyDate with a hard coded SQL statement, I get the correct results. I've stepped through and looked at the variables, and they seem right... I've already wasted so much time hunting, but I lack the expertise to pick out what I'm doing wrong.
 
Back
Top