Re: adding a simple WHERE clause to this MySQL query causes the result to contain 0 rows?!
| From: | Chris | Date: | Mon, 10 Aug 2009 05:17:28 +0000 |
| Subject: | Re: adding a simple WHERE clause to this MySQL query causes the result to contain 0 rows?! | ||
| References: | 1 2 3 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-46435@lists.php.net to get a copy of this message | ||
John Butler wrote:
Interesting.echo mysql_error(); You will need to quote your timestamps: .... where date(solarLandingDateTime) >= '" . mysql_real_escape_string($userPikStartDate) . "' AND date(solarLandingDateTime) <= '" . mysql_real_escape_string($userPikEndDate) . "' .... If all else fails, echo $query;Thanks Chris! You were right, I just needed to quote those incoming date form input values. I was trying to alert myself to any errors with this: $foundUniqueDateDirROWS = mysql_query($query) or die("query failed: " .mysql_error()); but it did not catch it. The query apparently worked.. just did not return any rows.
If you're using windows, it's very easy. http://www.apachefriends.org/en/index.html It has a webserver (apache), mysql, phpmyadmin + a bunch of other stuff included in the one download. One click installer .. voila. -- Postgresql & php tutorials http://www.designmagick.com/then copy it to mysql (either command line or something like phpmyadmin) and run it. What do you get?I know I need to duplicate the remote setup here on my local dev machine... but I have not done it. and being daunted by server admin stuff I have never even tried to run mysql from the command line. I do not know about phpadmin. I doubt it is available on the remote server I am working on (it's a newbie friend's box, not a shared host). I would ask for some clues but for all I know phpadmin is not only OT here, but also easy to educate myself more about before I take more of your time. I assume there is loads on google, etc...