1
TheFinni
CREATE TABLE IF NOT EXISTS on module install?
  • 2007/1/22 15:07

  • TheFinni

  • Just popping in

  • Posts: 75

  • Since: 2003/11/25


Why am I not able to use the "CREATE TABLE IF NOT EXISTS" in my MySQL file for a module installation?

The module installation stops saying I have: "You have an error in your SQL syntax". This same file is inserted properly using phpMyAdmin.

Another question of mine is why the $modversion['tables'][1] is needed in xoopsversion.php if the module install still installs every table that is within the MySQL install file?

The reason I would like to add a table depending on IF EXIST is that I have two modules that will share tables...but I want to be able to independently install each module without getting an installation errror from Xoops.

Any help would be greatly appreciated!

2
iHackCode
Re: CREATE TABLE IF NOT EXISTS on module install?

i think $modversion['tables'][1] is really needed when you uninstall a module. so XOOPS knows which tables to drop..

and your other question. what about using an onInstall function.
https://xoops.org/modules/mediawiki/index.php?title=Dev:database_tables
https://xoops.org/modules/mediawiki/index.php?title=Dev:xoops_install_uninstall
CBB / LatestNews / Publisher / XM-Spotlight

(ノ◕ヮ◕)ノ*:・゚✧

3
TheFinni
Re: CREATE TABLE IF NOT EXISTS on module install?
  • 2007/1/22 15:51

  • TheFinni

  • Just popping in

  • Posts: 75

  • Since: 2003/11/25


Hey that's perfect!

I have used the onUpdate function before but wasn't aware of the onInstall feature. This will work out great as I have 4 tables that are shared.

Yeah, I just had realized the $modversion['tables'][1] was used for uninstall...

Thanks for the info and the direct links to the XOOPS dev site!

Login

Who's Online

209 user(s) are online (140 user(s) are browsing Support Forums)


Members: 0


Guests: 209


more...

Donat-O-Meter

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

Latest GitHub Commits