dsp77 Posted October 19, 2009 Share Posted October 19, 2009 I have a table with the rows: ID, name, valid how can i make the "valid" row to have yes or no, true or false and what syntax would i use to view only the yes. Thank You Link to comment https://forums.phpfreaks.com/topic/178191-solved-help-with-mysql-syntax-truefalse/ Share on other sites More sharing options...
trq Posted October 19, 2009 Share Posted October 19, 2009 Set it to be of type int then use 0 to represent false and 1 to represent true. Link to comment https://forums.phpfreaks.com/topic/178191-solved-help-with-mysql-syntax-truefalse/#findComment-939504 Share on other sites More sharing options...
dsp77 Posted October 19, 2009 Author Share Posted October 19, 2009 thank you but now i have a new problem, i want to show to the user only the valid = 1 rows but not as 1 as yes. Link to comment https://forums.phpfreaks.com/topic/178191-solved-help-with-mysql-syntax-truefalse/#findComment-939509 Share on other sites More sharing options...
trq Posted October 19, 2009 Share Posted October 19, 2009 SELECT ID, Name, valid FROM tbl WHERE valid = 1 Link to comment https://forums.phpfreaks.com/topic/178191-solved-help-with-mysql-syntax-truefalse/#findComment-939526 Share on other sites More sharing options...
fenway Posted October 19, 2009 Share Posted October 19, 2009 ENUMs work too. Link to comment https://forums.phpfreaks.com/topic/178191-solved-help-with-mysql-syntax-truefalse/#findComment-939634 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.