[thelist] Wierd MySQL Behavior

Jay Blanchard jay.blanchard at niicommunications.com
Mon Apr 4 09:23:05 CDT 2005


[snip]
Maybe I'm missing something here.. I was at this piece of SQL over the
weekend and while my (mysql_num_rows == 0), MySQL also said "returning 0
of
0 rows (Displaying 1 record)" And it actually showed the record that I
wanted to pull up.

For fun, here is the query:

SELECT v.vid, v.x_company, v.VendorDescription, w.productid,
p.ProductPicture FROM TMDVendors v, TMDProducts p, TMDVendoroftheWeek w
WHERE v.vid = p.vid AND v.vid = w.vid AND p.productid = w.productid AND
startdate <= '20050404' and enddate > '20050404'

The one record had a startdate of 20050403 and an enddate of 20052404

Any idea as to why I'm getting two different answers from the same
query?
[/snip]

WHICH startdate and enddate? You have not aliased those, so the query
may be throwing odd results due to your joins. Typically MySQL sends an
'Empty set' message if there are no records.


More information about the thelist mailing list