sql errors in ac-install.php

Found a bug?
Let me know so I can sort it out

sql errors in ac-install.php

Postby steviedarl » Tue May 04, 2010 3:36 pm

I am unable to complete the installation of the database tables because of an ommission in the sql code in the ac-install.php file

This is the message I get during install:
Error creating database table - Insert Data - ITEMS
INSERT INTO `bookings_items` SET `id` = 1, `id_user` = 1, `desc_en` = 'Demo Item', `desc_es` = 'Demostración', `list_order`= 1, `state` = 1
Field 'id_ref_external' doesn't have a default value

What happens is that only 4 out of the 6 tables are created.

If I make the table: bookings_items id_ref_external NULL in the ac-install.php then start again with an empty database and re run the install script I then get all 6 tables, but further problems occur .....

When I try to login to the admin I get: ac-config.inc.php not found
When I go to main calendar page I see 3 boxes where the calendars should be and text inside each saying:
C:\apache\htdocs\calendar\ac-includes\ajaxac-config.inc.php not found

What is causing this error and how can get things working.
Many thanks.
Stephen.
steviedarl
 
Posts: 2
Joined: Tue May 04, 2010 2:38 pm

Re: sql errors in ac-install.php

Postby steviedarl » Tue May 04, 2010 7:52 pm

Hi Chris,
I've implemented the replacement code you gave in another post:
(define("AC_ROOT", $_SERVER["DOCUMENT_ROOT"].DIRECTORY_SEPARATOR);)
and now the main calendar page appears to be fine. Thanks.

To access the admin I chose to define the path directly, and not to use the preceeding few lines of code, and this worked also, so that's great, I can now try it out.

What I remain a little uncertain about is the sql issue in the install file.
As I said previously, on first install only 4 tables get created as the script aborts after the missing field insert in the 4th table.
My solution was to change the structure from Not Null into Null, so avoiding the error, but you will have made it Not Null for a good reason and so I'm not convinced my botch solution is ok.

It would be good to have your input on this.

Stephen.
steviedarl
 
Posts: 2
Joined: Tue May 04, 2010 2:38 pm

Re: sql errors in ac-install.php

Postby chris » Tue May 04, 2010 8:17 pm

Hi, sorry for not getting back to you on this earlier.

I see that you have resolved the path issue, this seems to be a common problem for people wanting to install it on a windows server and, as you have discovered, been commented upon several times in the forum :)

What I remain a little uncertain about is the sql issue in the install file.
As I said previously, on first install only 4 tables get created as the script aborts after the missing field insert in the 4th table.
My solution was to change the structure from Not Null into Null, so avoiding the error, but you will have made it Not Null for a good reason and so I'm not convinced my botch solution is ok.

The query simply stopped execting when it came upon the "problem". That is why you only got 4 tables.
I have no idea why your server was unable to "cope" with this definition of that specific field. I have installed this on many servers and have never had this problem :?
As to why I used the Not Null - no, no specific reason, probably a simple mistake on my part when I added this field. This field is actually not used in the calendar, it is just there "in case" anyone needs an extra field to link the calendar items with an existing database.

Anyway, glad to hear that you have been able to sort it all out :)

Chris
User avatar
chris
Site Admin
 
Posts: 1088
Joined: Mon Dec 17, 2007 7:42 pm
Location: Málaga, Spain

Re: sql errors in ac-install.php

Postby srelliott » Thu Jul 07, 2011 10:31 pm

I had the same issue on a Windows server running MySQL 5.5.8. It turns out that it wanted the id_ref_external defined. So I added a new line at 467.

// Dumping data for table `bookings_items` - DEMO ITEM
$sql["Insert Data - ITEMS"]="
INSERT INTO `".AC_DB_PREFIX."bookings_items` SET
`id` = 1,
`id_user` = 1,
`desc_en` = 'Demo Item',
`desc_es` = 'Demostración',
`list_order`= 1,
`state` = 1,
`id_ref_external`= 1
";
srelliott
 
Posts: 11
Joined: Thu Jul 07, 2011 10:28 pm


Return to Bugs

Who is online

Users browsing this forum: No registered users and 1 guest

cron