iversonm Posted July 11, 2008 Share Posted July 11, 2008 ok so i have a mysql database my problem is, when i named some rows i names it like this 1, 2, 3, 4, 5, 6,..... so when i do my query statement its WHEN 1='1' which makes it always true because all that is inside is 1 and 0s and then when i do it with a different row WHEN 3='1' which is always false. anyway of making this work without renaming the rows? Link to comment https://forums.phpfreaks.com/topic/114214-solved-query-problem-with-mysql/ Share on other sites More sharing options...
DarkWater Posted July 11, 2008 Share Posted July 11, 2008 Uhh....3 is never equal to one. I don't quite understand your database structure. Please show me the full structure. Link to comment https://forums.phpfreaks.com/topic/114214-solved-query-problem-with-mysql/#findComment-587269 Share on other sites More sharing options...
Third_Degree Posted July 11, 2008 Share Posted July 11, 2008 i think you are trying to say that the rows are being compared numerically instead of as strings. try this WHEN `3`='1' Link to comment https://forums.phpfreaks.com/topic/114214-solved-query-problem-with-mysql/#findComment-587274 Share on other sites More sharing options...
DarkWater Posted July 11, 2008 Share Posted July 11, 2008 You mean column? Column is not the same as row. WHY would you name your column 1, 2, 3, etc? That's completely ambiguous. Link to comment https://forums.phpfreaks.com/topic/114214-solved-query-problem-with-mysql/#findComment-587275 Share on other sites More sharing options...
Third_Degree Posted July 11, 2008 Share Posted July 11, 2008 woops, yes you are correct, column. Link to comment https://forums.phpfreaks.com/topic/114214-solved-query-problem-with-mysql/#findComment-587279 Share on other sites More sharing options...
vikramjeet.singla Posted July 11, 2008 Share Posted July 11, 2008 you may use like this: WHEN DB_NAME.1='1' but this would be the database dependent... suppose you have changed your db name in future it will not work.... so made a define for DB_NAME and for future please don't consider these type of field names... Link to comment https://forums.phpfreaks.com/topic/114214-solved-query-problem-with-mysql/#findComment-587313 Share on other sites More sharing options...
iversonm Posted July 11, 2008 Author Share Posted July 11, 2008 alright i changed it in the database all the fields have a z in front easy fix but i will admit im a retard for labeling them as 1,2,3,4..ect i wasnt thinking anyway problem solved but i bet you will see another topic later by me when i need more help on my stupid mistakes Link to comment https://forums.phpfreaks.com/topic/114214-solved-query-problem-with-mysql/#findComment-587334 Share on other sites More sharing options...
vikramjeet.singla Posted July 11, 2008 Share Posted July 11, 2008 no probs.... but do not repeat these again and again Link to comment https://forums.phpfreaks.com/topic/114214-solved-query-problem-with-mysql/#findComment-587400 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.