SchweppesAle Posted January 26, 2010 Share Posted January 26, 2010 Anyone know why the following query is returning 40 entries instead of 20? SELECT products.productid , products.keywords , products.categories , products.description , products.summary , products.brandid , products.price , products.detail_1 , brands.brandid as BID , products.name , brands.name AS BN FROM products LEFT JOIN brands ON (products.brandid = brands.brandid) WHERE (lcase(products.name) like '%shirt%' OR lcase(products.keywords) like '%shirt%' OR lcase(products.description) like '%shirt%' OR lcase(brands.name) like '%shirt%' OR lcase(products.summary) like '%shirt%' OR lcase(products.detail_1) like '%shirt%') AND products.status = '1' ORDER BY length(products.name) asc LIMIT 20, 40 Link to comment https://forums.phpfreaks.com/topic/189797-mysql-limit/ Share on other sites More sharing options...
SchweppesAle Posted January 26, 2010 Author Share Posted January 26, 2010 nvm, I solved this issue using the OFFSET function "LIMIT 20 OFFSET 20" Still wish I knew why Limit 20, 40 doesn't work though. It's kind of weird Link to comment https://forums.phpfreaks.com/topic/189797-mysql-limit/#findComment-1001635 Share on other sites More sharing options...
black_ice Posted January 26, 2010 Share Posted January 26, 2010 limit a,b a:start b:entries ,not end Link to comment https://forums.phpfreaks.com/topic/189797-mysql-limit/#findComment-1001648 Share on other sites More sharing options...
SchweppesAle Posted January 27, 2010 Author Share Posted January 27, 2010 limit a,b a:start b:entries ,not end *slams head on keyboard* lol, thanks Link to comment https://forums.phpfreaks.com/topic/189797-mysql-limit/#findComment-1002492 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.