Ninjakreborn Posted November 16, 2006 Share Posted November 16, 2006 I am recieving a large volume of data from check boxes.Here is the actual field information[code] <form name="form3" id="form3" action="eventincidentaccidentform4.php" method="post"> <table class="test"> <tr> <td colspan="4" style="text-align:left;"><h2>Action Taken(Select all that apply)</h2></td> </tr> <?php echo "<tr>"; select("actiontaken[abortedtakeoff]", "Aborted Takeoff", "abortedtakeoff"); select("actiontaken[cancelledflight]", "Cancelled Flight", "cancelledflight"); echo "</tr>"; echo "<tr>"; select("actiontaken[declaredemergency]", "Declared Emergency", "declaredemergency"); select("actiontaken[delayedflight]", "Delayed Flight", "delayedflight"); echo "</tr>"; echo "<tr>"; select("actiontaken[diversion]", "Diversion", "diversion"); select("actiontaken[goaround]", "Go Around", "goaround"); echo "</tr>"; echo "<tr>"; select("actiontaken[groundaircraftatoutstation]", "Ground AirCraft At Outstation", "groundaircraftatoutstation"); select("actiontaken[inflightshutdown]", "In Flight Shutdown", "inflightshutdown"); echo "</tr>"; echo "<tr>"; select("actiontaken[missedapproach]", "Missed Approach", "missedapproach"); select("actiontaken[returnaircrafttomaintenance]", "Return Aircraft To Maintenance", "returnaircrafttomaintenance"); echo "</tr>"; echo "<tr>"; select("actiontaken[returntogate]", "Return To Gate", "returntogate"); select("actiontaken[turnback]", "Turn Back", "turnback"); echo "</tr>"; ?> <tr><td colspan="4"><hr /></td></tr> <tr> <td colspan="4" style="text-align:left;"><label for="phaseofflight"><h2>Phase Of Flight:(Select One)</h2></label></td> </tr> <tr> <td colspan="4"><select name="phaseofflight" id="phaseofflight"> <option selected="selected">Please Select One!</option> <option>Fueling</option> <option>Towing</option> <option>Pre Flight</option> <option>Boarding</option> <option>Taxi Out</option> <option>Runup</option> <option>Takeoff</option> <option>Climb</option> <option>Cruise</option> <option>Holding</option> <option>Decent</option> <option>Approach</option> <option>Landing</option> <option>Taxi In</option> <option>Parking</option> <option>Deplanning</option> <option>Post Flight</option> </select></td> </tr> <tr><td colspan="4"><hr /></td></tr> <tr> <td colspan="4" style="text-align:left;"><h2>Classification(Select all that apply)</h2></td> </tr> <?php echo "<tr>"; select("classification[aircraftdamage]", "Aircraft Damage", "aircraftdamage"); select("classification[aircraftonrunway]", "Aircraft On Runway", "aircraftonrunway"); echo "</tr>"; echo "<tr>"; select("classification[aircraftlogsmanualsorphase]", "Aircraft Logs / Manuals / Phase (missing, incomplete, inaccurate)", "aircraftlogsmanualsorphase"); select("classification[airportclosure]", "Airport Closure", "airportclosure"); echo "</tr>"; echo "<tr>"; select("classification[alternatorfailure]", "Alternator Failure", "alternatorfailure"); select("classification[atcdelay]", "ATC Delay", "atcdelay"); echo "</tr>"; echo "<tr>"; echo "<td colspan=\"4\"><p style=\"padding-bottom:0px; margin-bottom:0px; text-align:left;\"><b>Avionics Failure</b></p></td>"; echo "</tr>"; echo "<tr>"; select("classification[avionicsfailure-communication]", "Communication", "communication"); echo "<td></td>"; echo "<td></td>"; echo "</tr>"; echo "<tr>"; select("classification[avionicsfailure-navigation]", "Navigation", "navigation"); echo "<td></td>"; echo "<td></td>"; echo "</tr>"; echo "<tr><td colspan=\"4\"> </td></tr>"; echo "<tr>"; select("classification[battery]", "Battery", "battery"); select("classification[birdstrike]", "Bird Strike", "birdstrike"); echo "</tr>"; echo "<tr>"; select("classification[brakefailure]", "Brake Failure", "brakefailure"); select("classification[collision]", "Collision (Aircraft Or Object)", "collision"); echo "</tr>"; echo "<tr>"; select("classification[crewincapacitation]", "Crew Incapacitation", "crewincapacitation"); select("classification[debrisonrunway]", "Debris On Runway", "debrisonrunway"); echo "</tr>"; echo "<tr>"; select("classification[deviationofatcinstructions]", "Deviation Of ATC Instructions", "deviationofatcinstructions"); select("classification[distruptiveorsickpassenger]", "Disruptive/Sick Passenger", "disruptiveorsickpassenger"); echo "</tr>"; echo "<tr>"; echo "<td colspan=\"4\"> </td>"; echo "</tr>"; echo "<tr>"; select("classification[doorwarning]", "Door Warning", "doorwarning"); echo "<td></td><td></td>"; echo "</tr>"; echo "<tr>"; text("classification[doorwarningwhichone]", "Which Door?", 200, ""); echo "<td></td><td></td>"; echo "</tr>"; echo "<tr>"; echo "<td colspan=\"4\"> </td>"; echo "</tr>"; echo "<tr>"; select("classification[dooropening]", "Door Opening", "cdooropening"); echo "<td></td><td></td>"; echo "</tr>"; echo "<tr>"; text("classification[dooropeningwhichone]", "Which Door?", 200, ""); echo "<td></td><td></td>"; echo "</tr>"; echo "<tr>"; echo "<td colspan=\"4\"> </td>"; echo "</tr>"; echo "<tr>"; select("classification[electricalfailure]", "Electrical Failure", "electricalfailure"); select("classification[emergencyevacuation]", "Emergency Evacuation", "emergencyevacuation"); echo "</tr>"; echo "<tr>"; select("classification[enginefailure]", "Engine Failure", "enginefailure"); select("classification[enginefire]", "Engine Fire", "enginefire"); echo "</tr>"; echo "<tr>"; select("classification[fireorsmokeincabin]", "Fire/Smoke In Cabin", "fireorsmokeincabin"); select("classification[flapfailure]", "Flap Failure", "flapfailure"); echo "</tr>"; echo "<tr>"; select("flattire", "Flat Tire", "flattire"); select("flightcontrolfailure", "Flight Control Failure", "flightcontrolfailure"); echo "</tr>"; echo "<tr>"; select("classification[fuelleak]", "Fuel Leak", "fuelleak"); select("classification[fuelquantity]", "Fuel Quantity", "fuelquantity"); echo "</tr>"; echo "<tr>"; select("classification[hardlanding]", "Hard Landing", "hardlanding"); select("classification[icing]", "Icing", "icing"); echo "</tr>"; echo "<tr>"; echo "<td colspan=\"4\" style=\"text-align:left;\"><p><b>Instrument Failure?</b></p></td>"; echo "</tr>"; echo "<tr>"; select("classification[flightinstrument]", "Flight Instrument", "flightinstrument"); echo "<td></td><td></td>"; echo "</tr>"; echo "<tr>"; text("classification[flightinstrumentwhich]", "Which One?", 200, ""); echo "<td></td><td></td>"; echo "</tr>"; echo "<tr>"; select("classification[engineinstrument]", "Engine Instrument", "engineinstrument"); echo "<td></td><td></td>"; echo "</tr>"; echo "<tr>"; text("classification[engineinstrumentwhich]", "Which One?", 200, ""); echo "<td></td><td></td>"; echo "</tr>"; echo "<tr><td colspan=\"4\"> </td></tr>"; echo "<tr>"; echo "<td><label for=\"landinggear\"><b>Landing Gear</b></label></td>"; echo "<td></td><td></td><td></td>"; echo "</tr>"; echo "<tr>"; select("classification[landinggear[blowdown]]", "Blow Down", "blowdown"); echo "<td></td><td></td>"; echo "</tr>"; echo "<tr>"; select("classification[landinggear[failtoextend]]", "Fail To Extend", "failtoextend"); echo "<td></td><td></td>"; echo "</tr>"; echo "<tr>"; select("classification[landinggear[failtoretract]]", "Fail To Retract", "failtoretract"); echo "<td></td><td></td>"; echo "</tr>"; echo "<tr>"; select("classification[landinggear[hydraulicleak]]", "Hydraulic Leak", "hydraulicleak"); echo "<td></td><td></td>"; echo "</tr>"; echo "<tr>"; select("classification[landinggear[hydraulicsystelfailure]]", "Hydraulic System Failure", "hydraulicsystelfailure"); echo "<td></td><td></td>"; echo "</tr>"; echo "<tr>"; select("classification[landinggear[indicationfailure]]", "Indication Failure", "indicationfailure"); echo "<td></td><td></td>"; echo "</tr>"; echo "<tr>"; echo "<td colspan=\"4\"> </td>"; echo "</tr>"; echo "<tr>"; select("classification[lighteningstrike]", "Lightening Strike", "lighteningstrike"); echo "<td></td><td></td>"; echo "</tr>"; echo "<tr>"; select("classification[magnetofailedorrough]", "Magneto (Failed Or Rough):", "magnetofailedorrough"); select("classification[nearmidaircollission]", "Near Mid-Air Collission", "nearmidaircollission"); echo "</tr>"; echo "<tr>"; select("classification[paxinjury]", "Pax Injury", "paxinjury"); select("classification[propstrike", "Prop Strike", "propstrike"); echo "</tr>"; echo "<tr>"; select("classification[roughengine]", "Rough Engine", "roughengine"); select("classification[runwayincursion]", "Runway Incursion", "runwayincursion"); echo "</tr>"; echo "<tr>"; select("classification[starterfailureorwarning]", "Starter (Failure Or Warning)", "failureorwarning"); select("classification[tailstrike]", "Tail Strike", "talestrike"); echo "</tr>"; echo "<tr>"; select("classification[turbulence]", "Turbulence", "turbulence"); select("classification[vacuumfailure]", "Vacuum Failure", "vacuumfailure"); echo "</tr>"; echo "<tr>"; select("classification[waketurbulence]", "Wake Turbulence", "waketurbulence"); select("classification[weatherbelowminimums]", "Weather Below Minimums", "weatherbelowminimums"); echo "</tr>"; echo "<tr>"; select("classification[weatherbelowhighminimums]", "Weather Below High Minimums", "weatherbelowhighminimums"); select("classification[weightandbalance]", "Weight And Balance", "weightandbalance"); echo "</tr>"; echo "<tr>"; select("classification[windshear]", "Wind Shear", "windshear"); echo "<td></td><td></td>"; echo "</tr>"; echo "<tr>"; select("classification[other]", "Other", "cother"); echo "<td colspan=\"2\"></td>"; echo "</tr>"; echo "<tr>"; text("classification[othertext]", "Required(if selected)", 200, ""); echo "<td colspan=\"2\"></td>"; echo "</tr>"; echo "<tr>"; echo "<td colspan=\"4\"> </td>"; echo "<tr>"; echo "<td colspan=\"4\"><label for=\"description\">Brief Description:</label></td>"; echo "</tr>"; echo "<tr>"; echo "<td colspan=\"4\"><textarea name=\"description\" id=\"description\" cols=\"30\" rows=\"10\"></textarea></td>"; echo "</tr>"; echo "<tr>"; echo "<td colspan=\"4\"><input name=\"submit\" id=\"submit\" type=\"submit\" value=\"Continue\" /><input name=\"clear\" id=\"clear\" type=\"reset\" value=\"Clear\" /></td>";echo "</tr>"; ?> </table> </form>[/code]You can see I am starting 1 array, 1 just drop down list, and another array.I have done a good job collecting, and arraying/validating the information.However now it's time for what is coming next, I have to create the database structure, of how to store it.So far I am making 1 new field of each of the action taken so it'sactiontaken-variableactiontaken-variable2in the database, if they are filled out, then those are put in as the variable name in the databaseI did the same for phase of flight which was just a select drop down menu, but now I have to do classification and there are like 50 different possible fields of data, I don't really want to create 50 fields of information, and pass through them like that, I don't see how this is going to workAny advice on a decent database strucutre, I have the first part of the table in the database worked out, because they were only text, and stuff on the first 2 form pages, but then I came across this. Quote Link to comment Share on other sites More sharing options...
fenway Posted November 16, 2006 Share Posted November 16, 2006 How about a table of name/value pairs? Quote Link to comment Share on other sites More sharing options...
Ninjakreborn Posted November 16, 2006 Author Share Posted November 16, 2006 unfortunately that's what I went ahead and had to do. Quote Link to comment Share on other sites More sharing options...
fenway Posted November 16, 2006 Share Posted November 16, 2006 Why "unfortunately"? If you have no control over the number of fields, you don't have much of a choice (unless you never need to query them ever again). Quote Link to comment Share on other sites More sharing options...
Ninjakreborn Posted November 16, 2006 Author Share Posted November 16, 2006 Well there are over now 100 fields almost int he database, 50 just for classification.I just ended up having to set them to either yes/no whether or not they were selected, but calling the data is going to be murderous Quote Link to comment Share on other sites More sharing options...
fenway Posted November 16, 2006 Share Posted November 16, 2006 I thought you went the name/value route... if so, who cares how many there are? 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.