# Schedules \[SOLVED\]

**URL:** <https://forum.phpvms.net/t/schedules-solved/2592>\
**Category:** phpVMS Legacy Support (v2/v5)\
**Created:** [May 4, 2010, 11:41pm UTC](https://forum.phpvms.net/t/schedules-solved/2592 "2010-05-04T23:41:54Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![TAV1702](https://forum.phpvms.net/user_avatar/forum.phpvms.net/tav1702/32/41_2.png) [@TAV1702](https://forum.phpvms.net/u/TAV1702)\
**Post date:** [May 4, 2010, 11:41pm UTC](https://forum.phpvms.net/t/schedules-solved/2592/1 "2010-05-04T23:41:54Z")

</div>

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),

---

<div class="post-metadata">

**Author:** ![nabeel](https://forum.phpvms.net/user_avatar/forum.phpvms.net/nabeel/32/2971_2.png) [@nabeel](https://forum.phpvms.net/u/nabeel)\
**Post date:** [May 4, 2010, 11:49pm UTC](https://forum.phpvms.net/t/schedules-solved/2592/2 "2010-05-04T23:49:55Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![TAV1702](https://forum.phpvms.net/user_avatar/forum.phpvms.net/tav1702/32/41_2.png) [@TAV1702](https://forum.phpvms.net/u/TAV1702)\
**Post date:** [May 4, 2010, 11:55pm UTC](https://forum.phpvms.net/t/schedules-solved/2592/3 "2010-05-04T23:55:04Z")

</div>

DOH!!! I never thought of that. Nabeel my friend, that is why you make the extremely big bucks. For smooth thinking like that.

---

<div class="post-metadata">

**Author:** ![TAV1702](https://forum.phpvms.net/user_avatar/forum.phpvms.net/tav1702/32/41_2.png) [@TAV1702](https://forum.phpvms.net/u/TAV1702)\
**Post date:** [May 5, 2010, 12:23am UTC](https://forum.phpvms.net/t/schedules-solved/2592/4 "2010-05-05T00:23:30Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![nabeel](https://forum.phpvms.net/user_avatar/forum.phpvms.net/nabeel/32/2971_2.png) [@nabeel](https://forum.phpvms.net/u/nabeel)\
**Post date:** [May 5, 2010, 12:50am UTC](https://forum.phpvms.net/t/schedules-solved/2592/5 "2010-05-05T00:50:27Z")

</div>

On the top of the import file, just put:

SET FOREIGN\_KEY\_CHECKS=0;

That should take care of it

---

<div class="post-metadata">

**Author:** ![TAV1702](https://forum.phpvms.net/user_avatar/forum.phpvms.net/tav1702/32/41_2.png) [@TAV1702](https://forum.phpvms.net/u/TAV1702)\
**Post date:** [May 6, 2010, 8:12pm UTC](https://forum.phpvms.net/t/schedules-solved/2592/6 "2010-05-06T20:12:43Z")

</div>

Ok thanks Nabeel. Will give that a go.

---

<div class="post-metadata">

**Author:** ![TAV1702](https://forum.phpvms.net/user_avatar/forum.phpvms.net/tav1702/32/41_2.png) [@TAV1702](https://forum.phpvms.net/u/TAV1702)\
**Post date:** [May 6, 2010, 8:28pm UTC](https://forum.phpvms.net/t/schedules-solved/2592/7 "2010-05-06T20:28:59Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![nabeel](https://forum.phpvms.net/user_avatar/forum.phpvms.net/nabeel/32/2971_2.png) [@nabeel](https://forum.phpvms.net/u/nabeel)\
**Post date:** [May 6, 2010, 10:02pm UTC](https://forum.phpvms.net/t/schedules-solved/2592/8 "2010-05-06T22:02:21Z")

</div>

Glad to hear it worked!
