Jump to content


Corporate Sponsors


Latest News: (loading..)

- - - - -

Changing default table names


7 replies to this topic

#1 freespace

  • Community Member
  • 9 posts
  • Real Name:Charlie

Posted 02 February 2012, 18:56

Hello,

I'm doing a new install of my oscommerce store. The problem that I'm having is that I'm allowed to have only 1 mysql database on my web hosting account (it's a free account). I have tables from my other websites already in the database and I keep track of them through the use of table name prefixes. That way i can tell which tables belong to which websites. I'll have to do the same thing with oscommerce tables. I want to add the prefix "osc_" to every table. I tried adding the prefix to the defined table names in database_tables.php but that didn't work. Does anybody know how this can be accomplished? Thanks
I'm on version 2.3.1

#2 geoffreywalton

  • Community Sponsor
  • 7,731 posts
  • Real Name:Geoffrey Walton
  • Gender:Male
  • Location:Norfolk, UK (close to the centre of the universe)

Posted 02 February 2012, 19:20

If you can reinstall then you can edit the table names in the file oscommerce.sql in the install directory and also change the names in the 2 database_tables.php files, then reinstall

Probably easier to do this

Backup the db in your shop admin, edit that file and change the name of the tables created.

Then import it.

Still need to change the 2 files as above.

HTH

G
Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

Virus Threat Scanner
My Contributions
Basic install answers.
Click here for Contributions / Add Ons.
UK your site.
Site Move.
Basic design info.

For links mentioned in old answers that are no longer here follow this link Useful Threads.

If this post was useful, click the Like This button over there ======>>>>>.

#3 freespace

  • Community Member
  • 9 posts
  • Real Name:Charlie

Posted 02 February 2012, 20:15

thanks for your input G, I'll do that tonight, BTW, is there an easy to edit the oscommerce.sql file, it's got almost 2000 lines of code, I just don't want to miss anything

#4 geoffreywalton

  • Community Sponsor
  • 7,731 posts
  • Real Name:Geoffrey Walton
  • Gender:Male
  • Location:Norfolk, UK (close to the centre of the universe)

Posted 02 February 2012, 20:18

search for "if exist"

You just need to do a search and replace on the lines containing "create "

G
Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

Virus Threat Scanner
My Contributions
Basic install answers.
Click here for Contributions / Add Ons.
UK your site.
Site Move.
Basic design info.

For links mentioned in old answers that are no longer here follow this link Useful Threads.

If this post was useful, click the Like This button over there ======>>>>>.

#5 freespace

  • Community Member
  • 9 posts
  • Real Name:Charlie

Posted 02 February 2012, 22:31

what about the insert statements? there're so many references to the table names, is there an easy way to do those?

#6 geoffreywalton

  • Community Sponsor
  • 7,731 posts
  • Real Name:Geoffrey Walton
  • Gender:Male
  • Location:Norfolk, UK (close to the centre of the universe)

Posted 02 February 2012, 22:49

Looks like you will need to do a search and replace for every table name

G
Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

Virus Threat Scanner
My Contributions
Basic install answers.
Click here for Contributions / Add Ons.
UK your site.
Site Move.
Basic design info.

For links mentioned in old answers that are no longer here follow this link Useful Threads.

If this post was useful, click the Like This button over there ======>>>>>.

#7 freespace

  • Community Member
  • 9 posts
  • Real Name:Charlie

Posted 02 February 2012, 23:47

that's what I was afraid of.....but I think what I'll do is install oscommerce with the default table names then change the table names through phpmyadmin and edit the 2 database_tables.php files to reflect the new names like you said in your earlier reply

if my theory is correct, I should be able to access the store without any problems

#8 freespace

  • Community Member
  • 9 posts
  • Real Name:Charlie

Posted 03 February 2012, 17:48

that works perfectly! my store is up and running now, thanks for the help...