Jump to content

less than operator not working right


loganbest

Recommended Posts

I have a shopping cart and I'm trying to add Previous and Next Product buttons. The next prod works fine but the previous is not.

SELECT p.product_Name, p.product_ID, i.prdctImage_FileName, it.imgType_Folder
FROM tbl_products p
	INNER JOIN tbl_skus S
	ON p.product_ID = S.SKU_ProductID
	LEFT JOIN tbl_prdtimages i
	ON p.product_ID = i.prdctImage_ProductID 
	LEFT JOIN tbl_list_imagetypes it
	ON i.prdctImage_ImgTypeID = it.imgType_ID 
WHERE 
	it.imgType_SortOrder = 1 AND i.prdctImage_ImgTypeID = 1 AND p.product_OnWeb = 1 AND S.SKU_Stock > 0 AND p.product_ID < '2326' LIMIT 1 

 

if product_ID > '2326' it will return 2327 which is correct. if product_ID < '2326' it will return 429, which should be 2325.

Link to comment
https://forums.phpfreaks.com/topic/211462-less-than-operator-not-working-right/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.