Jump to content

MySQL and PHP Tables


dudejma

Recommended Posts

I am trying to show inputs from a table that only affect that one person. I have a table that would get PIREP's (PIlot REPorts) into it. I'm wanting for, when one of my pilots login, then see the table, but only the flights that affect them. Is this possible? Thanks for all the help! If you need to contact me, my email is: ceo@virtualamerican.org. We are using an automated system called: phpVMS, which is great, but I would love to have my own system. Thanks for all the help, once again!

 

P.S. I run a Virtual Airline. A Virtual Airline is a non-profit organization that comes together and flies on a simulator such as Microsoft Flight Simulator.

Link to comment
Share on other sites

Is this what you're looking for?

CREATE TABLE IF NOT EXISTS `pireps` ( 
`ID` int(11) NOT NULL auto_increment,  
`Flight#` int(7) NOT NULL,  
`From` int(4) NOT NULL,  
`To` int(4) NOT NULL,  
`Fuel` decimal(10,0) NOT NULL,  
`FlightTime` decimal(10,0) NOT NULL,  
`Aircraft` int(11) NOT NULL,  
`Comments` int(11) NOT NULL,  
`Accepted` int(1) NOT NULL default '0',
`Pending` int(1) NOT NULL, 
`Denied` int(1) NOT NULL,
PRIMARY KEY  (`ID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=1 

Link to comment
Share on other sites

Oh. I forgot to put that in. Here, how's this look?

CREATE TABLE IF NOT EXISTS `pireps` ( 
`ID` int(11) NOT NULL auto_increment,
`PilotID` int(11) NOT NULL,
`Flight#` int(7) NOT NULL,  
`From` int(4) NOT NULL, 
`To` int(4) NOT NULL,  
`Fuel` decimal(10,0) NOT NULL,  
`FlightTime` decimal(10,0) NOT NULL,  
`Aircraft` int(11) NOT NULL,  
`Comments` int(11) NOT NULL,  
`Accepted` int(1) NOT NULL default '0',
`Pending` int(1) NOT NULL default '1', 
`Denied` int(1) NOT NULL default '0',
PRIMARY KEY  (`ID`)) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=1

Link to comment
Share on other sites

Now that's better. If you have pilot's ID, you can select all their flights using

SELECT * FROM pireps WHERE PilotID = idYouSearchFor

 

On a side note: this table seems to have suboptimal datatypes selected. There is no actual difference between INT(1) and INT(11)

Link to comment
Share on other sites

Ok. Thanks. I didn't know that. So how exactly would I do that? Once they login, they click on a link to the logbook. What would I put on the logbook page. Should I put a form where they put in there Pilot ID or is there a way where it would be automated to the user logged in. The username is the Pilot ID's.

Link to comment
Share on other sites

I will try it out and let you know. I'm still working on a lot of stuff. It sure would be usefull to have someone that knew PHP or if I knew it. I hate not knowing it. I wished I would've learned it. How long did it take you? Did you learn from a course or just from yourself.

Link to comment
Share on other sites

I've been working with different programming languages for almost 15 years now. Got some pretty good courses in general programming at secondary school. With PHP I've been working half/full time for 4 years now.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.