|Pathologically Eclectic Rubbish Lister|
MySQL Placeholder Date Problemby shockme (Chaplain)
|on Nov 25, 2003 at 16:31 UTC||Need Help??|
shockme has asked for the
wisdom of the Perl Monks concerning the following question:
I have code such as the following:
I've narrowed the following problem down to the involvement of $begDate and $endDate. Here's what's happening:
When I execute this, it always returns 0 rows. I've omitted some code which displays the contents of $SQL to me, as well as code which displays the contents of $begDate and $endDate. When I cut and paste the contents of $SQL and the values of $begDate and $endDate into the MySQL commandline, it returns over 1,000 rows (which is what I would expect). If I don't give it $begDate or $endDate, it works fine. However, any time I use the date logic, it returns 0 rows and no errors.
Also, if I omit the placeholders and construct the following:
It works like a charm, returning in excess of 1,000 rows.
So, I'm apparently missing something obvious in the placeholder construction/execution. Any suggestions?
(Note: Typos in the above are due to cut and paste errors.)
If things get any worse, I'll have to ask you to stop helping me.