I do use an abstraction layer for the db connection and info, but rather than doing it inside a function I just keep the code in a separate file and include it.
Generally it is advisable for a file containing the username/password to be kept outside the document root, if possible, so that the file cant easily be compromised if say, PHP happens to fail to parse it.
I must confess that I didnt really read you well :o
I thought that you were just comparing using include files for each function, rather than substituting functions with include files.
As superwormy mentioned, in most high level programming languages this is bad practice.
There may be problems in "hidden" variables, e.g. a namespace collision.
Also, your efficiency may actually be reduced instead, since it is possible that the parser has to read the code twice, rather than read it once and then execute it twice, if you're using that particular block of code twice.
I dont hack PHP though, so I cant really say for sure.
I dont think anyone can fault you on the dbconnect() case though, since the code should be run only once per script, and shouldnt involve many variables.
The part where a DB abstraction layer becomes useful is in actually handling the queries.