Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

MS2 - HOWTO change database table-names.


Clever&Clueless

Recommended Posts

MS2: For people whose ISP only gives them the use of a single shared database, you might like to rename your store database tables, so that you can: 1/ Install other instances of osCommerce (multiple stores) on the same database without conflict; 2/ Install other server apps that use the same database without conflict. (MS3 CVS will prefix your table names for you at install-time. But like I said, this is for MS2.)

 

Solution: Open these files for editing (good practice: don't use MS2 admin file manager, got a /n bug) in your choice of editor:

/yourstorepath/includes/database_tables.php

/yourstorepath/admin/includes/database_tables.php

 

And in PhpMyAdmin, edit:

/your_database_url/your_database

 

1/ Choose a prefix for the tables, such as "storename_". Paste this prefix in front of all the table names listed in the database_tables files. So:

define('TABLE_ADDRESS_BOOK', 'address_book');

would become:

define('TABLE_ADDRESS_BOOK', storename_address_book');

 

2/ In PhpMyAdmin select each store table (using the list from the database_tables file if you don't know which tables are osCommerce), and using the "Operations" tab, rename each table using your renaming scheme.

 

3/ Test your store!

 

If you're clever you can probably make a script which does all these things automagically, but not everyones as clever as you. :rolleyes:

 

E&OE

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...