Problem to import fight plan with CSV file

Please report Bugs and Problems here
Post Reply
Sp3cialFx
Ticket Agent
Posts: 7
Joined: Sat Apr 17, 2021 1:23 am

Problem to import fight plan with CSV file

Post by Sp3cialFx » Sat Apr 17, 2021 6:12 pm

Hello,
I read all the wiki, tuto, and post of this forum without managing to solve my problem, I can not make the import I have systematically this error message:
Array ( [0] => Array ( [file] => /home/fsa_www/views.crew/fp_import.php [line] => 336 [function] => db_query [args] => Array ( [0] => INSERT INTO fsa_route set Airline = 'Volcan'Air', Dep = 'LFLC', Arr = 'LHBP', DepTime = '0000', ArrTime = '0210', Route = 'BELE2W BELEP UP860 GIPNO UN871 DEGES Z2 XEBIX N871 BADVI L725 INPUL NURMI ARSIN VAJDI VAJD2T', ACDB_List = '847,57,969', Number = 'VCA051', Price = '123', Remarks = '', Simrate = '1', FlightType = '0', VA_ID = '49409', Days = '1234567', AC_ID = '0', limit_pax = '-1', limit_cargo = '-1', limit_flights = '0', Price_Business = '246', Price_First = '492', fleet_list = '', technical_stop = '' ) ) [1] => Array ( [file] => /home/fsa_www/public_html/crewcenter/index.php [line] => 271 [args] => Array ( [0] => /home/fsa_www/views.crew/fp_import.php ) [function] => include ) ) There was problem with the database request, please contact an admin
Here is what I am trying to import:
VCA051,LFLC,LHBP,0000,0210,A20N CRJ7 TBM9,847 57 969,,1x,,,BELE2W BELEP UP860 GIPNO UN871 DEGES Z2 XEBIX N871 BADVI L725 INPUL NURMI ARSIN VAJDI VAJD2T,,,,,,
VCA052,LHBP,LFLC,0000,0235,A20N CRJ7 TBM9,847 57 969,,1x,,,GILE2B GILEP ZOLKU ARSIN ERKIR L608 KPT L856 TRA Z69 OLBEN UN869 MEBAK Q20 SOPAD SOPA7A,,,,,,
VCA053,LFLC,LDZA,0000,0155,A20N CRJ7 TBM9,847 57 969,,1x,,,MADOT UP860 MEDAM UM730 ATMAD M730 TOP ASTOR ML602 D030S ELBUK LUPOS LURUT M859 BARPI Z495 OTFOX ILB ALIVO DARZA,,,,,,

Thank you for your help
Image

User avatar
Cat
Chief Pilot
Posts: 626
Joined: Wed Jan 06, 2016 5:56 am

Re: Problem to import fight plan with CSV file

Post by Cat » Sun Apr 18, 2021 12:56 am

You are missing the rest of the data stream in each line after the commas:

1234567,-1,-1,0,-1,

I just uploaded the first one into my test airline with the missing information added and it worked just fine.
Image

Sp3cialFx
Ticket Agent
Posts: 7
Joined: Sat Apr 17, 2021 1:23 am

Re: Problem to import fight plan with CSV file

Post by Sp3cialFx » Sun Apr 18, 2021 10:52 am

Thanks I had put them, but I was missing the last comma I think, I'll try right away :D
Image

Sp3cialFx
Ticket Agent
Posts: 7
Joined: Sat Apr 17, 2021 1:23 am

Re: Problem to import fight plan with CSV file

Post by Sp3cialFx » Sun Apr 18, 2021 11:03 am

I can't do it sorry
Array ( [0] => Array ( [file] => /home/fsa_www/views.crew/fp_import.php [line] => 336 [function] => db_query [args] => Array ( [0] => INSERT INTO fsa_route set Airline = 'Volcan'Air', Dep = 'LFLC', Arr = 'LROP', DepTime = '0000', ArrTime = '0130', Route = '', ACDB_List = '847,57,969', Number = 'VCA049', Price = '147', Remarks = '', Simrate = '1', FlightType = '0', VA_ID = '49409', Days = '1234567', AC_ID = '0', limit_pax = '-1', limit_cargo = '-1', limit_flights = '0', Price_Business = '294', Price_First = '588', fleet_list = '-1', technical_stop = '' ) ) [1] => Array ( [file] => /home/fsa_www/public_html/crewcenter/index.php [line] => 271 [args] => Array ( [0] => /home/fsa_www/views.crew/fp_import.php ) [function] => include ) ) There was problem with the database request, please contact an admin
VCA084,EIDW,LFLC,0000,0205,A20N CRJ7 TBM9,847 57 969,,1x,,,ABID1B PESIT BAKUR N546 STU P2 NUMPO NIGIT MID VEULE RESMI UM728 KETEX RISNO KOTIS A3 NEV ATRID ATRI7A,,1234567,-1,-1,0,-1,
Image

Sp3cialFx
Ticket Agent
Posts: 7
Joined: Sat Apr 17, 2021 1:23 am

Re: Problem to import fight plan with CSV file

Post by Sp3cialFx » Sun Apr 18, 2021 12:42 pm

I really don't understand

I make an export, I keep only the 1st line, I change only the Number in TEST, I launch an import and I have the error message

VCA048,LBSF,LFLC,0000,0305,A20N CRJ7 TBM9,847 57 969 1050,,1x,210v$,0,OGOT3S OGOTA T228 UTEKA SOMUN OKSIG OBALA LABIN LURUT RONOP UP860 MEBAK Q20 SOPAD SOPA7A,,1234567,-1,-1,0,-1,

TESTSF,LBSF,LFLC,0000,0305,A20N CRJ7 TBM9,847 57 969 1050,,1x,210v$,0,OGOT3S OGOTA T228 UTEKA SOMUN OKSIG OBALA LABIN LURUT RONOP UP860 MEBAK Q20 SOPAD SOPA7A,,1234567,-1,-1,0,-1,
Array ( [0] => Array ( [file] => /home/fsa_www/views.crew/fp_import.php [line] => 336 [function] => db_query [args] => Array ( [0] => INSERT INTO fsa_route set Airline = 'Volcan'Air', Dep = 'LBSF', Arr = 'LFLC', DepTime = '0000', ArrTime = '0305', Route = 'OGOT3S OGOTA T228 UTEKA SOMUN OKSIG OBALA LABIN LURUT RONOP UP860 MEBAK Q20 SOPAD SOPA7A', ACDB_List = '847,57,969,1050', Number = 'TESTSF', Price = '210', Remarks = '', Simrate = '1', FlightType = '0', VA_ID = '49409', Days = '1234567', AC_ID = '0', limit_pax = '-1', limit_cargo = '-1', limit_flights = '0', Price_Business = '420', Price_First = '840', fleet_list = '-1', technical_stop = '' ) ) [1] => Array ( [file] => /home/fsa_www/public_html/crewcenter/index.php [line] => 271 [args] => Array ( [0] => /home/fsa_www/views.crew/fp_import.php ) [function] => include ) ) There was problem with the database request, please contact an admin
Thanks for your help but it's still strange not to be able to re-import what was extracted
Image

User avatar
Cat
Chief Pilot
Posts: 626
Joined: Wed Jan 06, 2016 5:56 am

Re: Problem to import fight plan with CSV file

Post by Cat » Sun Apr 18, 2021 2:06 pm

Image

So however you are exporting this and then looking at it, the data is changing.

It would help if you have a signature in your forum post or at least tell us what VA is involved.
Image

Sp3cialFx
Ticket Agent
Posts: 7
Joined: Sat Apr 17, 2021 1:23 am

Re: Problem to import fight plan with CSV file

Post by Sp3cialFx » Sun Apr 18, 2021 7:56 pm

Re,

Yet this is the export line you commented on, on this route there are 2 CRJ one normal and one cargo version.

Thank you for your answers, I'll try one plane, I'll add the others later.

What you identify as an extra comma, is the remark field which is empty

Even with only one plane, it still doesn't work

Can you give me a line that passes through your house so that I can try on my side and make a diff please?

The VA is : Volcan'Air [49409]
Image

User avatar
Cat
Chief Pilot
Posts: 626
Joined: Wed Jan 06, 2016 5:56 am

Re: Problem to import fight plan with CSV file

Post by Cat » Sun Apr 18, 2021 8:36 pm

EXACTLY how are you uploading and downloading? Are you using a spreadsheet or a notepad file?

It works for me, here's the proof:
Image

The exported CSV file opened with Win10 Notepad looks like this:

Image

I then took the exported CSV file (NOTEPAD) and then imported it without making any changes at all:

Image
Image

Sp3cialFx
Ticket Agent
Posts: 7
Joined: Sat Apr 17, 2021 1:23 am

Re: Problem to import fight plan with CSV file

Post by Sp3cialFx » Sun Apr 18, 2021 8:59 pm

It's crazy that it doesn't work on my end.
Whatever text editor I'm using, I've tried with windows Notepad, I've tried with Notepad++,
I tried with different browsers, nothing works...
Even without modifying anything, just deleting the lines to leave only one doesn't work for me.

VCA001,LFLC,LFPO,0000,0110,A20N CRJ7 TBM9,847 57 969,,1x,96v$,0,MOU2W MOU MOU9E,,1234567,-1,-1,0,-1,

Array ( [0] => Array ( [file] => /home/fsa_www/views.crew/fp_import.php [line] => 336 [function] => db_query [args] => Array ( [0] => INSERT INTO fsa_route set Airline = 'Volcan'Air', Dep = 'LFLC', Arr = 'LFPO', DepTime = '0000', ArrTime = '0110', Route = 'MOU2W MOU MOU9E', ACDB_List = '847,57,969', Number = 'VCA001', Price = '96', Remarks = '', Simrate = '1', FlightType = '0', VA_ID = '49409', Days = '1234567', AC_ID = '0', limit_pax = '-1', limit_cargo = '-1', limit_flights = '0', Price_Business = '192', Price_First = '384', fleet_list = '-1', technical_stop = '' ) ) [1] => Array ( [file] => /home/fsa_www/public_html/crewcenter/index.php [line] => 271 [args] => Array ( [0] => /home/fsa_www/views.crew/fp_import.php ) [function] => include ) ) There was problem with the database request, please contact an admin

Can you copy and paste the line so I can take it as is copy from the post?

Thank you
Image

User avatar
joefremont
FSAirlines Developer
Posts: 2989
Joined: Tue May 16, 2006 5:46 am
Location: KSFO

Re: Problem to import fight plan with CSV file

Post by joefremont » Mon Apr 19, 2021 4:55 am

Sorry my delay in answering your questions, the powers supply in my flight sim computer, which I do most of my FSA work on, gave up on me and I have to resort to other means to get work done. Like pulling out one of my retired work computers, which is a mac, which means I can't fly on it.

As to the problem here, its because your VA name has an apostrophe in it and the code doing the importing is not taking that into account by properly escaping it. Let me see if I can get a fix our for that, it should not be that hard.
Image
I've sworn an oath of solitude until the pestilence is purged from the lands.

User avatar
joefremont
FSAirlines Developer
Posts: 2989
Joined: Tue May 16, 2006 5:46 am
Location: KSFO

Re: Problem to import fight plan with CSV file

Post by joefremont » Mon Apr 19, 2021 5:11 am

and it should now be fixed.
Image
I've sworn an oath of solitude until the pestilence is purged from the lands.

Sp3cialFx
Ticket Agent
Posts: 7
Joined: Sat Apr 17, 2021 1:23 am

Re: Problem to import fight plan with CSV file

Post by Sp3cialFx » Mon Apr 19, 2021 3:49 pm

Thanks a lot, it works perfectly now
Image

Post Reply