PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
sure.. your right..
I guess the question was - is it worth doing this kind of merging?
Or at the end of the day, 50 extra lines of code doesn't really effect anything?
-
If you have these two function working, you gain nothing by merging them except perhaps some easier editing when changing anything inside your query or DB later.
There is no general answer to this. Sometimes it's better to have a function that is used for exactly one purpose. Sometimes you may have some arguments, that might change the behaviour of a function depending on the arguments to not have redundant code parts.