TAV1702 Posted May 4, 2010 Report Share Posted May 4, 2010 Hi. I have a quick question. I have installed a fresh install of phpVMS and as we all know from my previous post, I have a databse issue trying to restore my old one. I have the site up and running with all of my airports, dloads, fleet and all. Now I wasnt to add my schedules, but now MaxLoad is no longer used. Can anyone tell me what part of this following snippet is the max load? I was thinking I might be able to manually remove the max load from each one or something like that and I could then import the corrected info so I would not have to redo a couple hundred schedules. Here is the insert with 1 of the schedules. Can you point out which part is maxload please? And would it be ok to attempt to do this? Obviously since I am starting from scratch, the times flown would be off too. Im not sure if it would be just as wise to start from scratch on schedules too or attempt this. INSRT INTO `phpvms_schedules` (`id`, `code`, `flightnum`, `depicao`, `arricao`, `route`, `route_details`, `aircraft`, `flightlevel`, `distance`, `deptime`, `arrtime`, `flighttime`, `daysofweek`, `maxload`, `price`, `flighttype`, `timesflown`, `notes`, `enabled`, `bidid`) VALUES (1,'TAV','0557','KMCI','PHNL','','',1,'',3909.67,'08:00 CST','03:12 CST',7.12,'0346',0,586,'P',3,'',1,0), Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted May 4, 2010 Administrators Report Share Posted May 4, 2010 Do you have the create table in the backup? What I'd do maybe is rename it all to phpvms_schedules2 (which a quick find/replace can do), then import that. So you'll have a phpvms_schedules and phpvms_schedules2.. then you can drop the maxload column for phpvms_schedules2, or just rename the table to phpvms_schedules Quote Link to comment Share on other sites More sharing options...
TAV1702 Posted May 4, 2010 Author Report Share Posted May 4, 2010 DOH!!!! I never thought of that. Nabeel my friend, that is why you make the extremely big bucks. For smooth thinking like that. Quote Link to comment Share on other sites More sharing options...
TAV1702 Posted May 5, 2010 Author Report Share Posted May 5, 2010 Well, it was a great idea, but yet again I get bit in the ass by that dam foreign key error on the server. My host dont know, he is just a reseller. Then he needs to get ahold of his reseller who most likely needs to get ahold of their reseller and so on. Time to switch hosts maybe? #1452 - Cannot add or update a child row: a foreign key constraint fails (`thunxxxxx_xxxxxx/phpvms_schedules2`, CONSTRAINT `phpvms_schedules2_ibfk_1` FOREIGN KEY (`code`) REFERENCES `phpvms_airlines` (`code`) ON UPDATE CASCADE) Obviously I put the x's here on purpose. Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted May 5, 2010 Administrators Report Share Posted May 5, 2010 On the top of the import file, just put: SET FOREIGN_KEY_CHECKS=0; That should take care of it Quote Link to comment Share on other sites More sharing options...
TAV1702 Posted May 6, 2010 Author Report Share Posted May 6, 2010 Ok thanks Nabeel. Will give that a go. Quote Link to comment Share on other sites More sharing options...
TAV1702 Posted May 6, 2010 Author Report Share Posted May 6, 2010 Nabeel My friend, you are just the MAN! Thanks a million. That just saved me loads of work. I took your trick from dropping and renaming to and from schedules2 to get rid of maxload and then did the 2nd trick on import and it was flawless. 1 Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted May 6, 2010 Administrators Report Share Posted May 6, 2010 Glad to hear it worked! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.