Jump to content

SicKn3sS

New Members
  • Posts

    8
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

SicKn3sS's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Okay I figured it out myself: while($row = mysql_fetch_assoc($result)) { foreach($row as $field => $value) { $updateValue=$_POST[$field]; // replace value in db with update value } } Not exactly how I wanted it, but it works. I'm just posting the solution encase people find this post on google or search
  2. Since I didn't quote you, you know I meant to address topic creator. I would suggest something constructive if the man had a constructive purpose. Why would you want to dump a bunch of un-validate, un-checked, un-used, un-processed, and probably un-wanted data into database? Only the admin account is able to access the page and he knows what he is doing. That's what I want to do but I can't figure out how. Can someone tell me?
  3. That's right but I have about 30 fields and they are subject to change any time so I need to loop to find each field.
  4. Hey, how can I make a loop to input all this POST data into my database? Content-Length: 677 ID=2&Units+in+Canada=10&Instrument=H-7000&Category=TEM&Filament=777-0179&Filament+Cartridge=&LAB-6+or+Consumable+Emitter=747-0466%2F747-0299&Fixed+Condenser+Aperture=533-1101+%281000u%29&EDX+Objective+Movable+Aperture=&Condenser+Movable+Aperture=747-1565+%28300-200-50-20u%29&Objective+Movable+Aperture=747-1732+%28160-80-40-20u%29&Beam+Monitor+Aperture=&DPA+or+OBJ+Fixed+Aperture=&Selected+Area+Movable+Aperture=747-1567+%28400-200-100-50u%29&Viewing+Screen=747-0326&Spot+Viewing+Screen=&PMT=J386012+%28R268%29&STEM+Scintillator=533-0286&BSE+Detector=&Track+Ball=&Outer+Viewing+Screen=747-0246&Wehnelt+Assembly=&Whenelt+Contact+Spring=542-1106&Wehnelt+for+Cartridge=
  5. Ahh I see, I forgot to pass it a variable. It works now thanks
  6. It just shows up as nothing now :/
  7. Hey, how can I echo a table such as this? <tr><td>$field:</td><td><input type="text" field="$value" value="$value" /></td></tr> I don't know how to make it echo the quotes as html.
  8. Hello, Is there a way to echo 30 fields without telling the php app each field name? my code looks like this: $category=TEM; $query="SELECT * FROM `Hitachi Consumables` WHERE Instrument='$instrument'"; $result=mysql_query($query,$sql); $num=mysql_numrows($result); mysql_close(); echo "$instrument <br><br>"; $i=0; while ($i < $num) { $filament=mysql_result($result,$i,"Filament"); $filCart=mysql_result($result,$i,"Filament Cartridge"); $l6=mysql_result($result,$i,"LAB-6 or Consumable Emitter"); $updatedBy=mysql_result($result,$i,"Updated by"); $fixedCondenserAperture=mysql_result($result,$i,"Fixed Condenser Aperture"); $movableAperture=mysql_result($result,$i,"EDX Objective Movable Aperture"); $conMovableAperature=mysql_result($result,$i,"Condenser Movable Aperture"); $objMovableAperature=mysql_result($result,$i,"Objective Movable Aperture"); $beamMA=mysql_result($result,$i,"Beam Monitor Aperture"); $DBAOBJ=mysql_result($result,$i,"DPA or OBJ Fixed Aperture"); $SEMA=mysql_result($result,$i,"Selected Area Movable Aperture"); $viewScreen=mysql_result($result,$i,"Viewing Screen"); $sViewScreen=mysql_result($result,$i,"Spot Viewing Screen"); $PMT=mysql_result($result,$i,"PMT"); $STEMs=mysql_result($result,$i,"STEM Scintillator"); $BSEDetector=mysql_result($result,$i,"BSE Detector"); $trackBall=mysql_result($result,$i,"Track Ball"); $OVS=mysql_result($result,$i,"Outer Viewing Screen"); $wehneltAssembly=mysql_result($result,$i,"Wehnelt Assembly"); $wehneltCS=mysql_result($result,$i,"Whenelt Contact Spring"); $wehneltfC=mysql_result($result,$i,"Wehnelt for Cartridge"); echo "<b>Filament:</b> $filament<br> <b>Filament Cartridge:</b> $filCart<br> <b>LAB-6 or Consumable Emitter:</b> $l6<br> <b>Fixed Condenser Aperture:</b> $fixedCondenserAperture<br> <b>EDX Objective Movable Aperture:</b> $movableAperture<br> <b>Condenser Movable Aperture:</b> $conMovableAperature<br> <b>Objective Movable Aperture:</b> $objMovableAperature<br> <b>Beam Monitor Aperture:</b> $beamMA<br> <b>DPA or OBJ Fixed Aperture:</b> $DBAOBJ<br> <b>Selected Area Movable Aperture:</b> $SEMA<br> <b>Viewing Screen:</b> $viewScreen<br> <b>Spot Viewing Screen:</b> $sViewScreen<br> <b>PMT:</b> $PMT<br> <b>STEM Scintillator:</b> $STEMs<br> <b>BSE Detector:</b> $BSEDetector<br> <b>Track Ball:</b> $trackBall<br> <b>Outer Viewing Screen:</b> $OVS<br> <b>Wehnelt Assembly:</b> $wehneltAssembly<br> <b>Whenelt Contact Spring:</b> $wehneltCS<br> <b>Wehnelt for Cartridge:</b> $wehneltfC<br>"; $i++; } I would like to somehow shrink all the code down after "while ($i < $num) {".
×
×
  • 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.