Forum Moderators: bakedjake

Message Too Old, No Replies

MySQL kicking a wierd result

MySQL kicking a wierd result

         

evanf

8:38 pm on Aug 4, 2003 (gmt 0)

10+ Year Member



Heres the issue, i running a query that runs fine untill i try and sort it. THe query is as follows:

SELECT Products.ProductID, Products.ProductDescription, Products.ProductDescription, Categories.Category, Products.ProductRestrictions FROM (Products LEFT JOIN relCustomerProducts ON Products.ProductID = relCustomerProducts.ProductID) LEFT JOIN (Categories LEFT JOIN relCustomerCategories ON Categories.CategoryID = relCustomerCategories.CategoryID) ON Products.ProductCategory = Categories.CategoryID WHERE (((Products.ProductRestrictions)=0)) OR (((Products.ProductRestrictions)=1) AND ((relCustomerProducts.CustomerID)='01158')) OR (((Products.ProductRestrictions)=1) AND ((relCustomerCategories.CustomerID)='01158')) LIMIT 1,10

When a ORDER BY is added it kicks out the same result for all the items (but the proper number of items). When the ORDER BY is removed, it works fine, vending just the data i need. Any ideas?

monitor is giving me a headache,

evan

jatar_k

7:45 pm on Aug 5, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld evanf,

that seems strange, are you doing this in a terminal or with a script?

bcolflesh

7:58 pm on Aug 5, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Why is Products.ProductDescription SELECTed twice?

evanf

11:14 pm on Aug 5, 2003 (gmt 0)

10+ Year Member



The ProductDescription field being called twice was a typo when posting, its not in the query. The query is being run from a script, but produces the same result via terminal. Its really wierd that just adding a sort would hose the script. hmmmmmmmmm...........