linux1880 Posted July 15, 2010 Share Posted July 15, 2010 hi friends I have seen lots of select queries with (where 1=1) for example "SELECT * FROM categories WHERE 1=1 " why use (where 1=1) when same can be achieved by "SELECT * FROM categories " Link to comment https://forums.phpfreaks.com/topic/207824-why-to-use-where-11-in-mysql-queries/ Share on other sites More sharing options...
trq Posted July 15, 2010 Share Posted July 15, 2010 These are generally used when you might dynamically add AND clauses to there WHERE clause. It just depends on your logic for adding them. Link to comment https://forums.phpfreaks.com/topic/207824-why-to-use-where-11-in-mysql-queries/#findComment-1086401 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.