hvandracas Posted January 12, 2011 Share Posted January 12, 2011 Okey, i have the query: SELECT * FROM inventory LEFT JOIN items ON (inventory.itemid = items.itemid) LEFT JOIN ginklai ON (items.lenta = 'ginklai' AND items.subid = ginklai.weaponid) LEFT JOIN itemdescs ON (itemdescs.descid = items.aprasymas) WHERE inventory.charid = '3' AND inventory.uzdetas = '0' AND ginklai.rusis <= '8' AND ginklai.rusis <> '0' AND ginklai.upgrade <> '0' AND items.lenta = 'ginklai' it evaluates 1 row as it should and everything's fine, BUT if i change the number ... ginklai.rusis <= '8' to ginklai.rusis <= '11' it shows no results.. I cannot understand why because both of them 8 and 11 are higher than ginklai.rusis (which is 2) Quote Link to comment https://forums.phpfreaks.com/topic/224179-really-strange-thing/ Share on other sites More sharing options...
PFMaBiSmAd Posted January 12, 2011 Share Posted January 12, 2011 A) Store numbers using a numeric data type, such as INT B) Don't put numbers in single-quotes inside your query. Single-quotes go around string data, not numbers. Quote Link to comment https://forums.phpfreaks.com/topic/224179-really-strange-thing/#findComment-1158346 Share on other sites More sharing options...
hvandracas Posted January 12, 2011 Author Share Posted January 12, 2011 1) the field type is INT(4) 2) I'll try to. Quote Link to comment https://forums.phpfreaks.com/topic/224179-really-strange-thing/#findComment-1158348 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.