Topic: SQL Script Not Executing All INSERTS in admin/create_coy.php

Hello,

I've noticed that when I create a new company not all tables are being populated. Specifically, I've modified the INSERT for feeding chart_class table.

The following _won't work_ and all remaining INSERT won't execute:

INSERT INTO `1_chart_class` (`cid`, `class_name`, `balance_sheet`) VALUES
(5, 'Gross', 0),
(2, 'Liabilities', 1),
(1, 'Assets', 1),
(4, 'Costs', 0);

The following _will_ work:

INSERT INTO `1_chart_class` (`cid`, `class_name`, `balance_sheet`) VALUES (5, 'Gross', 0);
INSERT INTO `1_chart_class` (`cid`, `class_name`, `balance_sheet`) VALUES (2, 'Liabilities', 1);
INSERT INTO `1_chart_class` (`cid`, `class_name`, `balance_sheet`) VALUES (1, 'Assets', 1);
INSERT INTO `1_chart_class` (`cid`, `class_name`, `balance_sheet`) VALUES (4, 'Costs', 0);

Is this a parsing issue? Is it because FA expect a whole INSERT clause per line? Many SQL backup scripts will generate INSERT clauses in multiple lines.

Regards,

Alex Saavedra

Re: SQL Script Not Executing All INSERTS in admin/create_coy.php

Hello alex,

Yes, there is some simplifications in db_import function which are cost of smaller source code size. The import function must work properly with FA backup files, and it do.

Anyway when MySQL dump file is made out of FA installation (for example via phpmyadmin) correct settings ensure compatibility with db_import(). First of all  this is MYSQL323 compatibility option and DROP TABLE + IF NOT EXISTS usage.
With other options you can experiment to achieve best results.

Janusz