1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. To combat forum spam, new accounts will need to make at least one (valid) post.
    Otherwise, we will periodically purge all users without posts or that haven't confirmed their account.

MySQL syntax error

Discussion in 'Installation / Upgrade Questions' started by wampa, Apr 9, 2011.

Thread Status:
Not open for further replies.
  1. wampa

    wampa New Member

    I encountered an error while trying to set up the database. Here's what I get in the database menu:

    There was an error reading data from the mySQL database.

    However, the connection to the database was successful!

    Please click to run the installation script, setupSQL.php
    to set up the database.

    The error was reported as:

    Unknown column 'startDate' in 'where clause'


    No events will be saved until this issue is resolved.


    Then when I click on setupsql.php I get this back:

    > The connection to the mySQL database was successful!

    > There was an error creating the mySQL database table.

    The error was reported as:
    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 'TYPE=MyISAM AUTO_INCREMENT=6' at line 19



    I'm really new at MySQL so I haven't had much luck yet. Before running the above I made sure to create a database with a epc_calendar table that is blank except for the first field having a name of id. I tried changing the storage engine from InnoDB to MyISAM but that didn't seem to make a difference. I read up on there being problems with having 'TYPE' in the script vs 'ENGINE' but I'm not sure how to access the script to change it, or if that is even the real issue. Any help you guys could give would be greatly appreciated.

    BTW I'm currently running xampp and php 5.3.5
     
  2. Brian

    Brian EPC Developer Staff Member

    Try running this SQL and see if it works:

    CREATE TABLE `epc_calendar` (
    `id` int(7) NOT NULL auto_increment,
    `startDate` int(11) NOT NULL default '0',
    `endDate` int(11) NOT NULL default '0',
    `startTime` time NOT NULL default '00:00:00',
    `endTime` time NOT NULL default '00:00:00',
    `eventType` text NOT NULL,
    `repeatx` int(7) NOT NULL default '0',
    `title` text NOT NULL,
    `descr` text NOT NULL,
    `days` int(7) NOT NULL default '0',
    `stop` int(7) NOT NULL default '0',
    `month` tinyint(2) NOT NULL default '0',
    `weekDay` tinyint(1) NOT NULL default '0',
    `weekNumber` tinyint(1) NOT NULL default '0',
    `category` text NOT NULL,
    `eventKey` text NOT NULL,
    PRIMARY KEY (`id`)
    ) TYPE=MyISAM AUTO_INCREMENT=1 ;
     
  3. Brian

    Brian EPC Developer Staff Member

    If that doens't work, remove "TYPE=MyISAM AUTO_INCREMENT=1".
     
  4. wampa

    wampa New Member

    I took out the last line and it worked. Thanks Brian!
     
Thread Status:
Not open for further replies.

Share This Page