1
m0nty
module DB table sql install help
  • 2005/5/16 17:25

  • m0nty

  • XOOPS is my life!

  • Posts: 3337

  • Since: 2003/10/24


i'm trying to modify a module so that it is as easy as possible to clone.

i have this at the top of my xoops_version.php

$MODULE_DIRNAME 'xreviews';
$MOD_PREFIX $MODULE_DIRNAME;


then further down i have:

$modversion['dirname'] = $MODULE_DIRNAME;

$modversion['tables'][0] = $MOD_PREFIX."_reviews";


both these work fine once it's installed as original.

but if i change the dirname to say 'xreviews2' and then try to install the module it tells me that the tables already exist.

this is because in the mysql.sql file i have the following:

CREATE TABLE xreviews_reviews


is there a way i can substitute the prefix in the sql file for the $MOD_PREFIX value when installing?

Login

Who's Online

401 user(s) are online (340 user(s) are browsing Support Forums)


Members: 0


Guests: 401


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits