gandolf1212 Posted August 4, 2003 Share Posted August 4, 2003 Okay, I\'m writing a script that I was to have an infinite amount of selection conditions. Think something like foreach($condition as $_){ $con .= "$_ AND"; } // enter code to get rid of that last AND... $result = mysql_query("select * from `table` where $con"); However, will something go wrong is there are too many conditions? I mean, I\'m not talking thousands, but like 50? 100? I know there will be performance issues but that\'s not a big deal, so long as were just talking 5-10 seconds, maybe a tad more but definitely well under 30, which seems to be timeout level. Anyone know a better alternative? I was thinking about doing a big loop of mysql_result checks but would that even be faster? (I know there are a ton of optimizations in mySQL). Plus the way I have now is soooo easy. I mean, I turned a collage level problem into a comp sci 1 extra credit problem with my idea, just kinda looking for a better implementation of basically the same idea. especially a way to break that one huge query into many smaller queries. Thanks a bunch if you can help. I\'m not that good on mySQL yet when it comes to the higher level queries. (doc\'s seem way to reference like to really read through). Quote Link to comment https://forums.phpfreaks.com/topic/827-unlimented-selection-conditions/ 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.