Fork me on GitHub

DBUtil fail creating and deleting tables  Bottom

  • Hi,

    I'm trying to get used to using DBUtil rather than the old method when programming modules for my sites...

    The current phpinit.php is at this address: http://new.t3nettet.…Economy/pninit.phps

    Can anyone tell me why Zikula returns the following error when trying to init the module??

    Code

    Error! Sorry! Table creation failed. (T3NFuel_data, 1, 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '( id INTEGER NOT NULL AUTO_INCREMENT, user_id ' at line 1)


    Regards,
    Morten



    edited by: BlackChart, Dec 13, 2008 - 12:32 PM
  • Hi Morten
    With DBUtil you need to move that $SQL stuff to thje pntables.php file, in an array form. Please check the /modules/Pages/pntables.php and /modules/Pages/pninit.php code to see a working example.

    I guess that a better option than have the DB dict in $SQL is to make the array definition in pntables.php icon_wink

    BTW, i'm not sure, but AUTO_INCREMENT should be applied to a PRIMARY field?

    --
    - Mateo T. -
    Mis principios... son mis fines
  • Thank you, followed your advice, looked at the Pages modules pninit and pntables and made a similar for my module and now it works (at least the initialization of the module, haven't tried deleting it yet :))
  • it'll work without problems
    and with very few lines icon_wink

    --
    - Mateo T. -
    Mis principios... son mis fines

This list is based on users active over the last 60 minutes.