alvin567 Posted July 23, 2012 Share Posted July 23, 2012 Hi,there, I am to search from a databases,it will return the results 1 or 0, I need to manipulate from the sql queries such that it will return 1 as yes and 0 as no. Link to comment Share on other sites More sharing options...
fenway Posted July 23, 2012 Share Posted July 23, 2012 You mean you want your search to return the count instead of actual results? Link to comment Share on other sites More sharing options...
alvin567 Posted July 23, 2012 Author Share Posted July 23, 2012 or a row returns results as 1 or 0, I want to display as Yes or no Link to comment Share on other sites More sharing options...
Jessica Posted July 23, 2012 Share Posted July 23, 2012 You would either do it in PHP or do the same thing as described in my post here: http://forums.phpfreaks.com/index.php?topic=362361.msg1714461#msg1714461 SELECT IF(col IS 0, 'No', 'Yes') as col If that doesn't help post your code. Link to comment Share on other sites More sharing options...
alvin567 Posted July 24, 2012 Author Share Posted July 24, 2012 Hey,I am trying to select a count of m and f. Link to comment Share on other sites More sharing options...
Jessica Posted July 24, 2012 Share Posted July 24, 2012 That is not what you've said in your other two posts. You need to explain the problem clearly. You've been given solutions for two possible interpretations of this. Link to comment Share on other sites More sharing options...
fenway Posted July 25, 2012 Share Posted July 25, 2012 Post your query -- not your whole code. Link to comment Share on other sites More sharing options...
Recommended Posts