Jump to content

Request - Scritp to add regs in same acft.


Junior

Recommended Posts

sry for my bad english skills..

mates, unfortunately i'm new in this php thing and I just need a little help. Is there any script that we can use to add more registrations in one aircraft? my va will operate a lot of airlines and its kinda hard to add 20x777's, 56x737's, etc. Someone said to me in this forum I have to add in the database but I dont want mess up the database so how can I do that? does someone have a script to add only registrations for the same type of a/c?

thanks for your support - take care all - cheers!

Link to comment
Share on other sites

Nightfox, some airlines have massive amounts of aircraft. Case in hand, lets take a quick look at UPS.

http://www.planespotters.net/Airline/United-Parcel-Service-%28UPS%29

As you can see, they have a MASSIVE amount of aircraft. And yeah, to add each one in by hand sure is a PITA but it is a necessary evil Junior.

You could always grab a copy of your database, download WAMP server, import your database and edit it on your local host server. If you screw it up, no big loss since your original one is still intact on your website. ;)

Link to comment
Share on other sites

Nightfox, some airlines have massive amounts of aircraft. Case in hand, lets take a quick look at UPS.

http://www.planespot...rvice-%28UPS%29

As you can see, they have a MASSIVE amount of aircraft. And yeah, to add each one in by hand sure is a PITA but it is a necessary evil Junior.

You could always grab a copy of your database, download WAMP server, import your database and edit it on your local host server. If you screw it up, no big loss since your original one is still intact on your website. ;)

I asked why he needs it, as he has not mentioned the name of the VA. i just asked him a question. If he has a fictional VA and just starting, he is starting out unrealistically with 20 777 and 56 737's. Don't bite peoples heads off for just asking a question.

Link to comment
Share on other sites

sry for my bad english skills..

mates, unfortunately i'm new in this php thing and I just need a little help. Is there any script that we can use to add more registrations in one aircraft? my va will operate a lot of airlines and its kinda hard to add 20x777's, 56x737's, etc. Someone said to me in this forum I have to add in the database but I dont want mess up the database so how can I do that? does someone have a script to add only registrations for the same type of a/c?

thanks for your support - take care all - cheers!

If you have access to phpmyadmin, do this ->

Ensure you have at least 1 of each of the aircraft you want

Goto the phpvms_aircraft table

Select export

it should download a file called phpvms_aircraft.sql

Open it with Notepad (I prefer Notepad++)

Should look similar to:


CREATE TABLE IF NOT EXISTS `phpvms_aircraft` (
 `id` int(11) NOT NULL auto_increment,
 `icao` varchar(4) NOT NULL default '',
 `name` varchar(12) NOT NULL default '',
 `fullname` varchar(50) NOT NULL default '',
 `registration` varchar(30) NOT NULL,
 `downloadlink` text NOT NULL,
 `imagelink` text NOT NULL,
 `range` varchar(15) NOT NULL default '0',
 `weight` varchar(15) NOT NULL default '0',
 `cruise` varchar(15) NOT NULL default '0',
 `maxpax` float NOT NULL default '0',
 `maxcargo` float NOT NULL default '0',
 `minrank` int(11) NOT NULL default '0',
 `ranklevel` int(11) NOT NULL default '0',
 `enabled` smallint(6) NOT NULL default '1',
 PRIMARY KEY  (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=75 ;

--
-- Dumping data for table `phpvms_aircraft`
--

INSERT INTO `phpvms_aircraft` (`id`, `icao`, `name`, `fullname`, `registration`, `downloadlink`, `imagelink`, `range`, `weight`, `cruise`, `maxpax`, `maxcargo`, `minrank`, `ranklevel`, `enabled`) VALUES
(1, 'H500', 'AH-6F', 'MD Little Bird', '444', '', '', '232 nm', '1591 lbs', '135 kn', 6, 1509, 9, 4, 1),
(2, 'B06', 'KIOWA OH-58', 'Bell Kiowa OH-58', '31010', '', '', '481 km', '1583', '102', 2, 1500, 9, 4, 1);

Mind you I've edited some of the code for sanity reasons...

Copy the first line, paste it below the second line. Make sure you paste it enough times to ensure you have enough of that aircraft

So, if I wanted 3 H500's

INSERT INTO `phpvms_aircraft` (`id`, `icao`, `name`, `fullname`, `registration`, `downloadlink`, `imagelink`, `range`, `weight`, `cruise`, `maxpax`, `maxcargo`, `minrank`, `ranklevel`, `enabled`) VALUES
(1, 'H500', 'AH-6F', 'MD Little Bird', '444', '', '', '232 nm', '1591 lbs', '135 kn', 6, 1509, 9, 4, 1),
(2, 'B06', 'KIOWA OH-58', 'Bell Kiowa OH-58', '31010', '', '', '481 km', '1583', '102', 2, 1500, 9, 4, 1);
(1, 'H500', 'AH-6F', 'MD Little Bird', '444', '', '', '232 nm', '1591 lbs', '135 kn', 6, 1509, 9, 4, 1),
(1, 'H500', 'AH-6F', 'MD Little Bird', '444', '', '', '232 nm', '1591 lbs', '135 kn', 6, 1509, 9, 4, 1),

Make sure to change the extra 1's or you'll get an error. Also, change the registration (in my case 444)

INSERT INTO `phpvms_aircraft` (`id`, `icao`, `name`, `fullname`, `registration`, `downloadlink`, `imagelink`, `range`, `weight`, `cruise`, `maxpax`, `maxcargo`, `minrank`, `ranklevel`, `enabled`) VALUES
(1, 'H500', 'AH-6F', 'MD Little Bird', '444', '', '', '232 nm', '1591 lbs', '135 kn', 6, 1509, 9, 4, 1),
(2, 'B06', 'KIOWA OH-58', 'Bell Kiowa OH-58', '31010', '', '', '481 km', '1583', '102', 2, 1500, 9, 4, 1);
(3, 'H500', 'AH-6F', 'MD Little Bird', '434', '', '', '232 nm', '1591 lbs', '135 kn', 6, 1509, 9, 4, 1),
(4, 'H500', 'AH-6F', 'MD Little Bird', '424', '', '', '232 nm', '1591 lbs', '135 kn', 6, 1509, 9, 4, 1),

Now, do the same with the second aircraft.

lastly, make sure the last line has ; after the ) otherwise it could cause problems.

Also make sure to start where your database leaves off, so if the last aircraft in the database is 70, then

INSERT INTO `phpvms_aircraft` (`id`, `icao`, `name`, `fullname`, `registration`, `downloadlink`, `imagelink`, `range`, `weight`, `cruise`, `maxpax`, `maxcargo`, `minrank`, `ranklevel`, `enabled`) VALUES
(71, 'H500', 'AH-6F', 'MD Little Bird', '444', '', '', '232 nm', '1591 lbs', '135 kn', 6, 1509, 9, 4, 1),
(72, 'B06', 'KIOWA OH-58', 'Bell Kiowa OH-58', '31010', '', '', '481 km', '1583', '102', 2, 1500, 9, 4, 1),
(73, 'H500', 'AH-6F', 'MD Little Bird', '434', '', '', '232 nm', '1591 lbs', '135 kn', 6, 1509, 9, 4, 1),
(74, 'H500', 'AH-6F', 'MD Little Bird', '424', '', '', '232 nm', '1591 lbs', '135 kn', 6, 1509, 9, 4, 1);

Go back to phpmyadmin, select the phpvms_aircraft table, then the SQL tab, copy from INSERT all the way to ;

Click go, and it'll tell you either error or success.

Good luck, hope it helps.

Link to comment
Share on other sites

^ that's way too confusing if they don't know SQL, and they can really mess it up if they make errors.

Best bet is to make an excel spreadsheet with the headings along the top row:

icao, name, fullname, registration, downloadlink, imagelink, range, weight, cruise, maxpax, maxcargo, minrank, ranklevel, enabled

In the next row add the data for one registration of an aircraft type and then copy the row, changing the registrations. Repeat for the other type.

Save as a csv, import to the aircraft table using the import tab, choosing csv as the file type.

Link to comment
Share on other sites

I've got a problem editing the mysql via phpMyAdmin

Error:

--------------------------------------------------------------------------------------------------------

SQL query:

( 2, 'B744', 'B747-400', 'Boeing 747-400', 'N413ST', '', '', '7260', '393263', '493', 416, 410677, 5, 5, 1 ) ;

MySQL said: Documentation

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '2, 'B744', 'B747-400', 'Boeing 747-400', 'N413ST', '', '', '7260', '393263', '49' at line 1

--------------------------------------------------------------------------------------------------------

I copy and paste the contents of the attached file...

Can anyone let me know what am I doing wrong

aircraft import.txt

Link to comment
Share on other sites

I've got a problem editing the mysql via phpMyAdmin

Error:

--------------------------------------------------------------------------------------------------------

SQL query:

( 2, 'B744', 'B747-400', 'Boeing 747-400', 'N413ST', '', '', '7260', '393263', '493', 416, 410677, 5, 5, 1 ) ;

MySQL said: Documentation

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '2, 'B744', 'B747-400', 'Boeing 747-400', 'N413ST', '', '', '7260', '393263', '49' at line 1

--------------------------------------------------------------------------------------------------------

I copy and paste the contents of the attached file...

Can anyone let me know what am I doing wrong

for anyone else who is stuck like I was I found a solution...

click the SQL tab in phpmyadmin (while in the phpvms_aircraft table) and type the following in (replacing with your own A/C data values) and hit "Go"

--------------------------------------------------------------------------------------------------------

INSERT INTO `phpvms_aircraft` VALUES (1, 'B744', 'B747-400', 'Boeing 747-400', 'N412ST', '', '', '7260', '393263', '493', 416, 410677, 5, 5, 1);

INSERT INTO `phpvms_aircraft` VALUES (2, 'B744', 'B747-400', 'Boeing 747-400', 'N413ST', '', '', '7260', '393263', '493', 416, 410677, 5, 5, 1);

INSERT INTO `phpvms_aircraft` VALUES (3, 'B744', 'B747-400', 'Boeing 747-400', 'N414ST', '', '', '7260', '393263', '493', 416, 410677, 5, 5, 1);

INSERT INTO `phpvms_aircraft` VALUES (4, 'B744', 'B747-400', 'Boeing 747-400', 'N415ST', '', '', '7260', '393263', '493', 416, 410677, 5, 5, 1);

INSERT INTO `phpvms_aircraft` VALUES (5, 'B744', 'B747-400', 'Boeing 747-400', 'N416ST', '', '', '7260', '393263', '493', 416, 410677, 5, 5, 1);

--------------------------------------------------------------------------------------------------------

Hope this helps you :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...