dudejma Posted June 25, 2010 Share Posted June 25, 2010 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. Quote Link to comment https://forums.phpfreaks.com/topic/205864-mysql-and-php-tables/ Share on other sites More sharing options...
Mchl Posted June 25, 2010 Share Posted June 25, 2010 Yes it is (most likely) possible. To tell you how, you would need to show us your table structure. Quote Link to comment https://forums.phpfreaks.com/topic/205864-mysql-and-php-tables/#findComment-1077257 Share on other sites More sharing options...
dudejma Posted June 25, 2010 Author Share Posted June 25, 2010 Table structure as in? LOL! I'm a newbie. Are you wanting me to export it, then put that? Or just tell you what I have in my table? Quote Link to comment https://forums.phpfreaks.com/topic/205864-mysql-and-php-tables/#findComment-1077293 Share on other sites More sharing options...
Mchl Posted June 25, 2010 Share Posted June 25, 2010 Most useful would be if you pasted result of SHOW CREATE TABLE yourTableName; query. Quote Link to comment https://forums.phpfreaks.com/topic/205864-mysql-and-php-tables/#findComment-1077295 Share on other sites More sharing options...
dudejma Posted June 25, 2010 Author Share Posted June 25, 2010 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 Quote Link to comment https://forums.phpfreaks.com/topic/205864-mysql-and-php-tables/#findComment-1077323 Share on other sites More sharing options...
Mchl Posted June 25, 2010 Share Posted June 25, 2010 There seems to be no information in this table indicating which pilot was assigned to given flight. Are there other tables in the database? Quote Link to comment https://forums.phpfreaks.com/topic/205864-mysql-and-php-tables/#findComment-1077334 Share on other sites More sharing options...
dudejma Posted June 25, 2010 Author Share Posted June 25, 2010 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 Quote Link to comment https://forums.phpfreaks.com/topic/205864-mysql-and-php-tables/#findComment-1077337 Share on other sites More sharing options...
Mchl Posted June 25, 2010 Share Posted June 25, 2010 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) Quote Link to comment https://forums.phpfreaks.com/topic/205864-mysql-and-php-tables/#findComment-1077348 Share on other sites More sharing options...
dudejma Posted June 25, 2010 Author Share Posted June 25, 2010 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. Quote Link to comment https://forums.phpfreaks.com/topic/205864-mysql-and-php-tables/#findComment-1077351 Share on other sites More sharing options...
Mchl Posted June 25, 2010 Share Posted June 25, 2010 I don't know how your site is constructed, but I owuld assume, that when they log in, their ID is fetched from database. Quote Link to comment https://forums.phpfreaks.com/topic/205864-mysql-and-php-tables/#findComment-1077378 Share on other sites More sharing options...
dudejma Posted June 25, 2010 Author Share Posted June 25, 2010 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. Quote Link to comment https://forums.phpfreaks.com/topic/205864-mysql-and-php-tables/#findComment-1077384 Share on other sites More sharing options...
Mchl Posted June 25, 2010 Share Posted June 25, 2010 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. Quote Link to comment https://forums.phpfreaks.com/topic/205864-mysql-and-php-tables/#findComment-1077396 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.