Re: adding a simple WHERE clause to this MySQL query causes the result to contain 0 rows?!

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



John Butler wrote:
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.

Interesting.

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...

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/


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux