Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Table Prefixing


dkap

Recommended Posts

Posted

This isn't a new request, obviously...

 

http://www.oscommerce.com/forums/index.php?sho...=0entry165283

http://www.oscommerce.com/forums/index.php?sho...=0entry257622

http://www.oscommerce.com/forums/index.php?sho...=0entry129189

http://www.oscommerce.com/forums/index.php?sho...t=0entry92411

http://www.oscommerce.com/forums/index.php?sho...t=0entry76069

http://www.oscommerce.com/forums/index.php?showtopic=24732&st=0

 

and many more, I'm sure. So, I'll start by repeating the request to have this officially integrated into the distribution. Sure, it's easy to manually add in, but it's such a trivial programming step and such an unneeded annoyance for users, I don't see any reason to not do it. Also, contributions that add new db tables need prefixing manually added, so there's potential for missed items when upgrading versions of various things over time.

 

In addition to requesting table prefixing, I would also like to see the database name optionally prefixed to the table name for all db queries. This makes it much easier to run a second MySQL program that is in a different database, such as a hit logger. This is a very common oversight; rarely do programmers take into account how their work will interact with someone else's... But when it's an easy fix and there is no downside, it's worth paying attention to.

 

Example:

 

define('TABLE_CUSTOMERS', 'osCommerce_customers');

 

change to:

 

define('TABLE_CUSTOMERS', DB_DATABASE .'.osCommerce_customers');

 

I plan on going through the table definitions and trying that out to make sure it doesn't trigger any unexpected glitches...

 

Dan

Posted
I plan on going through the table definitions and trying that out to make sure it doesn't trigger any unexpected glitches...

Just did so and it appears to be working fine.

 

Dan

Archived

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

×
×
  • Create New...