Hi,
I have to write a dynamic page which has to run on several platforms, using
different databases. Because of that, I want to write a small db-front-end
which is an almost 1-on-1 mapping of the functions provided by the PHP API
(and the proper front-end is loaded using a conditional include).
Using the "C-way", I thought of using define(), but in PHP that can only be
used for defining constants. I also though of using function variables, but
then the feel of the code changes.
The simplest method I have found sofar is the following (for mysql_connect):
function sql_connect()
{
$p = func_get_args() ;
return ( call_user_func_ array('mysql_co nnect', $p) );
}
Anybody got any other ideas?
Thanks,
--
Martijn
I have to write a dynamic page which has to run on several platforms, using
different databases. Because of that, I want to write a small db-front-end
which is an almost 1-on-1 mapping of the functions provided by the PHP API
(and the proper front-end is loaded using a conditional include).
Using the "C-way", I thought of using define(), but in PHP that can only be
used for defining constants. I also though of using function variables, but
then the feel of the code changes.
The simplest method I have found sofar is the following (for mysql_connect):
function sql_connect()
{
$p = func_get_args() ;
return ( call_user_func_ array('mysql_co nnect', $p) );
}
Anybody got any other ideas?
Thanks,
--
Martijn
Comment