Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

changing predefined function input parameters


geo0428

Recommended Posts

I am having trouble changing the predefined input parameters on a tep_database function.

 

The input definition is:

 

function tep_db_connect($server = DB_SERVER, $username = DB_SERVER_USERNAME, $password = DB_SERVER_PASSWORD, $database = DB_DATABASE, $link = 'db_link') {

 

I want to change the $database value to DB_OLM_DATABASE

 

The following code

tep_db_connect(,,,DB_OLM_DATABASE);

gives the following error message

Parse error: parse error, unexpected ',', expecting ')' in /home/vhemming/public_html/OLM_Store/includes/application_top.php on line 67

Link to comment
Share on other sites

Why are you changing the tep_database function ?

 

By the sounds of what you are doing you should be changing your config file not the function ...

 

PhilipH

Link to comment
Share on other sites

Why are you changing the tep_database function ?

 

By the sounds of what you are doing you should be changing your config file not the function ...

 

PhilipH

 

I am not changing the function. I am trying to override the $database default input parameter. The reason for doing this is to connect to a second database so that I can exchange information between this database and my osComm database.

 

DB_OLM_DATABASE is a second database name that I added to my config file. I guess the bigger question is are the tep_db functions set up for making connections to the default database and another database and exchanging information between the databases. If so, how do you do that?

Link to comment
Share on other sites

Ok

 

The following code appears to add a connection to my DB_OLM_DATABASE without destroying the connect to my default database DB_DATABASE.

tep_db_connect(DB_SERVER,DB_SERVER_USERNAME,DB_SERVER_PASSWORD,DB_OLM_DATABASE)

 

Now my question is can I use the other tep_database functions on my DB_OLM_DATABASE by overriding $database default input parameters? Or, do I have other problems. The reason I? m asking is because I have never tried this before.

Link to comment
Share on other sites

Ok

 

The following code appears to add a connection to my DB_OLM_DATABASE without destroying the connect to my default database DB_DATABASE.

tep_db_connect(DB_SERVER,DB_SERVER_USERNAME,DB_SERVER_PASSWORD,DB_OLM_DATABASE)

 

Now my question is can I use the other tep_database functions on my DB_OLM_DATABASE by overriding $database default input parameters?  Or, do I have other problems.  The reason I? m asking is because I have never tried this before.

Link to comment
Share on other sites

Ok

 

The following code appears to add a connection to my DB_OLM_DATABASE without destroying the connect to my default database DB_DATABASE.

tep_db_connect(DB_SERVER,DB_SERVER_USERNAME,DB_SERVER_PASSWORD,DB_OLM_DATABASE)

 

Now my question is can I use the other tep_database functions on my DB_OLM_DATABASE by overriding $database default input parameters?  Or, do I have other problems.  The reason I? m asking is because I have never tried this before.

 

 

As a minimum you have to also override $link = 'db_link' but I have some other problems

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...