I'm sure this has been asked a million times but I can't seem to
formulate a google search that returns what i'm looking for.
I've go a dev and live environment. Currently the DB connect string is
hard coded into each php file which means i'm going to have to change
every page - Arrgh!!
If i put the DBonnect into a function and store it in an include file,
it doesn't seem to work, Also the connetion works with inline PHP
statements, but I have to repeat it in every function even if they are
in the main php file??? which doesn't seem right to me..
I need to either :-
Store the connection variables in an include file and retrieve them as
Store the connection string in a function in an include file which can
be accessed by all functions.
also do I really have to call the dbconnect inside every function.
Please note, if it makes any difference, I still havn't got my head
round OO programming in PHP so it is still pretty much procedural. I
am using PEAR but dont really understand (or care at the moment) about
what it is doing.
Thanks in advance