Page 1 of 1

error SQL

PostPosted: Sun Apr 10, 2011 6:49 pm
by catchap
Hello,
I have this message at the install (server OVH) :

Error creating database table - Create Table - BOOKINGS
CREATE TABLE IF NOT EXISTS `bookings` ( `id` int(11) NOT NULL auto_increment, `id_item` int(20) NOT NULL default '0', `the_date` date NOT NULL default '0000-00-00', `id_state` int(11) NOT NULL default '0', `id_booking` int(10) NOT NULL default '0', PRIMARY KEY (`id`), KEY `id_item` (`id_item`), KEY `id_state` (`id_state`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
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 'DEFAULT CHARSET=utf8 AUTO_INCREMENT=1' at line 10

Could you help me please ?

Re: error SQL

PostPosted: Sun Apr 10, 2011 7:00 pm
by chris
Hi,
I seem to remember this being an issue before for another user. It appears that some servers don't like/allow the ENGINE=MyISAM.

Could you open up the ac-install.php file and remove this from the create queries:
Code: Select all
ENGINE=MyISAM

A search and replace (with nothing) on the document should work fine.

Chris

Re: error SQL

PostPosted: Sun Apr 10, 2011 7:19 pm
by catchap
Thanks for your fast answer,
I've tried, but it's the same result :

Error creating database table - Create Table - BOOKINGS
CREATE TABLE IF NOT EXISTS `bookings` ( `id` int(11) NOT NULL auto_increment, `id_item` int(20) NOT NULL default '0', `the_date` date NOT NULL default '0000-00-00', `id_state` int(11) NOT NULL default '0', `id_booking` int(10) NOT NULL default '0', PRIMARY KEY (`id`), KEY `id_item` (`id_item`), KEY `id_state` (`id_state`) ) DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
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 'DEFAULT CHARSET=utf8 AUTO_INCREMENT=1' at line 10

Re: error SQL

PostPosted: Sun Apr 10, 2011 7:48 pm
by chris
Hmmm, not sure what else to suggest.
That query works fine on my server (just checked).

Have you tried running it directly in phpmyadmin or similar?

Chris

Re: error SQL

PostPosted: Sun Apr 10, 2011 10:09 pm
by catchap
when I install the calendar locally (apache), I have another problem. The tables are created and the calendar appears good, but ..... I cannot access the following months. I have the following error message that appears:

Notice: Undefined variable: error in C:\Program Files\EasyPHP-5.3.6.0\www\calendar\ac-includes\db_connect.inc.php on line 19

Warning: mktime() expects parameter 4 to be long, string given in C:\Program Files\EasyPHP-5.3.6.0\www\calendar\ac-includes\functions.inc.php on line 20

Warning: cal_days_in_month() expects parameter 2 to be long, string given in C:\Program Files\EasyPHP-5.3.6.0\www\calendar\ac-includes\functions.inc.php on line 22
ERROR checking id item availability dates
Champ 'NaN' inconnu dans where clause

one idea ?

Re: error SQL

PostPosted: Wed Apr 13, 2011 7:03 pm
by catchap
I solved the problem by removing "DEFAULT CHARSET=utf8".
Everything is now ok.
Thank you very much for this application, Chris :))

Re: error SQL

PostPosted: Wed Apr 13, 2011 10:24 pm
by chris
Hi,
Sorry I missed your original post, I don't often do that. :(

I'm glad to hear that you fixed it and also to know the solution. I wonder why your server doesn't like "DEFAULT CHARSET=utf8" ?

Thanks

Chris