Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Web Coding › PHP HTML & MySQL not updating records on edit
New Posts  All Forums:Forum Nav:

PHP HTML & MySQL not updating records on edit

post #1 of 6
Thread Starter 
I've tried everything I can think of and I have had no luck getting this to work. I do a search for a record number (id) that pulls up an HTML form, the form is populated with all of the data in the mysql database.
Code:
<?php
        $var= @$_GET['id'];
        $trimmed = trim($var);
        $limit=10;
        
        if ($trimmed == "") {
                echo"<p>Please enter a search...</p>";
                exit;
        }
        if (!isset($var)) {
                echo "<p>There is no search parameter...</p>";
                exit;
        }
        mysql_connect("localhost","ketocon_quila","mischief");
        mysql_select_db("ketocon_quila") or die("Unable to select database");
        $query = "SELECT * FROM Items2 WHERE id = $id ORDER by id";
        $result = mysql_query($query);
        echo '<form action="edit_form.php" method="post">';
        echo '<table border="2" width="5000" cellspacing="0" cellpadding="3">';
        echo "<tr>";
        echo '<th width="8">DBID</th>';
        echo '<th width="12">SoD Item ID</th>';
        echo '<th width="4">Tier</th>';
        echo '<th width="255">ItemName</th>';
        echo '<th width="4">AC</th>';
        echo '<th width="4">STR</th>';
        echo '<th width="4">STA</th>';
        echo '<th width="4">DEX</th>';
        echo '<th width="4">AGI</th>';
        echo '<th width="4">CHA</th>';
        echo '<th width="4">WIS</th>';
        echo '<th width="4">INT</th>';
        echo '<th width="4">HP</th>';
        echo '<th width="4">Mana</th>';
        echo '<th width="4">MR</th>';
        echo '<th width="4">FR</th>';
        echo '<th width="4">CR</th>';
        echo '<th width="4">PR</th>';
        echo '<th width="4">DR</th>';
        echo '<th width="6">FT</th>';
        echo '<th width="6">CrtStr</th>';
        echo '<th width="6">MdShld</th>';
        echo '<th width="6">StnRes</th>';
        echo '<th width="6">DmgRed</th>';
        echo '<th width="6">Aggr</th>';
        echo '<th width="6">SplWrd</th>';
        echo '<th width="12">Instrument</th>';
        echo '<th width="6">InsMod</th>';
        echo '<th width="12">BaneType</th>';
        echo '<th width="6">BneDmg</th>';
        echo '<th width="12">SkillMod</th>';
        echo '<th width="6">ModAmt</th>';
        echo '<th width="255">FocusEffect</th>';
        echo '<th width="255">SpellEffect</th>';
        echo '<th width="6">WpnDmg</th>';
        echo '<th width="6">WpnDly</th>';
        echo '<th width="6">WpnTyp</th>';
        echo '<th width="6">Ear</th>';
        echo '<th width="6">Neck</th>';
        echo '<th width="6">Head</th>';
        echo '<th width="6">Face</th>';
        echo '<th width="6">Chest</th>';
        echo '<th width="6">Back</th>';
        echo '<th width="6">Arms</th>';
        echo '<th width="6">Shldrs</th>';
        echo '<th width="6">Wrist</th>';
        echo '<th width="6">Waist</th>';
        echo '<th width="6">Hands</th>';
        echo '<th width="6">Fingers</th>';
        echo '<th width="6">Legs</th>';
        echo '<th width="6">Feet</th>';
        echo '<th width="6">Primry</th>';
        echo '<th width="6">Secdry</th>';
        echo '<th width="6">Range</th>';
        echo '<th width="6">Ammo</th>';
        echo '<th width="6">Charm</th>';
        echo '<th width="6">T2 Aug</th>';
        echo '<th width="6">T3 Aug</th>';
        echo '<th width="6">T5 Aug</th>';
        echo '<th width="255">Mob</th>';
        echo '<th width="4">BRD</th>';
        echo '<th width="4">BST</th>';
        echo '<th width="4">CLR</th>';
        echo '<th width="4">DRU</th>';
        echo '<th width="4">ENC</th>';
        echo '<th width="4">MAG</th>';
        echo '<th width="4">MNK</th>';
        echo '<th width="4">NEC</th>';
        echo '<th width="4">PAL</th>';
        echo '<th width="4">RNG</th>';
        echo '<th width="4">ROG</th>';
        echo '<th width="4">SHD</th>';
        echo '<th width="4">SHM</th>';
        echo '<th width="4">WAR</th>';
        echo '<th width="4">WIZ</th>';
        echo "</tr>";
        
        while ($row=mysql_fetch_array($result)) {
?>
<tr>
<td><? echo $row['id']; ?></td>
<td><input type="number" name="soditemid" size=6 value="<? echo $row['soditemid']; ?>" /></td>
<td><input type="number" name="tier" size=4 value="<? echo $row['Tier']; ?>" /></td>
<td><input type="text" name="itemname" size=80 value="<? echo $row['ItemName']; ?>" /></td>
<td><input type="number" name="itemac" size=5 value="<? echo $row['AC']; ?>" /></td>
<td><input type="number" name="itemstr" size=5 value="<? echo $row['STR']; ?>" /></td>
<td><input type="number" name="itemsta" size=5 value="<? echo $row['STA']; ?>" /></td>
<td><input type="number" name="itemdex" size=5 value="<? echo $row['DEX']; ?>" /></td>
<td><input type="number" name="itemagi" size=5 value="<? echo $row['AGI']; ?>" /></td>
<td><input type="number" name="itemcha" size=5 value="<? echo $row['CHA']; ?>" /></td>
<td><input type="number" name="itemwis" size=5 value="<? echo $row['WIS']; ?>" /></td>
<td><input type="number" name="itemint" size=5 value="<? echo $row['INT']; ?>" /></td>
<td><input type="number" name="itemhp" size=5 value="<? echo $row['HP']; ?>" /></td>
<td><input type="number" name="itemmana" size=5 value="<? echo $row['Mana']; ?>" /></td>
<td><input type="number" name="itemmr" size=5 value="<? echo $row['MR']; ?>" /></td>
<td><input type="number" name="itemfr" size=5 value="<? echo $row['FR']; ?>" /></td>
<td><input type="number" name="itemcr" size=5 value="<? echo $row['CR']; ?>" /></td>
<td><input type="number" name="itempr" size=5 value="<? echo $row['PR']; ?>" /></td>
<td><input type="number" name="itemdr" size=5 value="<? echo $row['DR']; ?>" /></td>
<td><input type="number" name="itemft" size=5 value="<? echo $row['FT']; ?>" /></td>      
<td><input type="number" name="itemcs" size=5 value="<? echo $row['CS']; ?>" /></td>
<td><input type="number" name="itemms" size=5 value="<? echo $row['MS']; ?>" /></td>
<td><input type="number" name="itemsr" size=5 value="<? echo $row['SR']; ?>" /></td>
<td><input type="number" name="itemdmgr" size=5 value="<? echo $row['DmgR']; ?>" /></td>
<td><input type="number" name="itemaggr" size=5 value="<? echo $row['Aggr']; ?>" /></td>
<td><input type="number" name="itemsw" size=5 value="<? echo $row['SpellWard']; ?>" /></td>
<td><input type="text" name="instrument" size=15 value="<? echo $row['Instrument']; ?>" /></td>
<td><input type="number" name="instrumentmod" size=5 value="<? echo $row['InstrumentMod']; ?>" /></td>
<td><input type="text" name="banetype" size=15 value="<? echo $row['BaneType']; ?>" /></td>
<td><input type="number" name="banedmg" size=5 value="<? echo $row['BaneDmg']; ?>" /></td>
<td><input type="text" name="skillmod" size=15 value="<? echo $row['SkillMod']; ?>" /></td>
<td><input type="number" name="skillmodamt" size=5 value="<? echo $row['SkillModAmt']; ?>" /></td>
<td><input type="text" name="focuseffect" size=80 value="<? echo $row['FocusEffect']; ?>" /></td>
<td><input type="text" name="spelleffect" size=80 value="<? echo $row['SpellEffect']; ?>" /></td>
<td><input type="number" name="weapondmg" size=5 value="<? echo $row['WeaponDmg']; ?>" /></td>
<td><input type="number" name="weapondly" size=5 value="<? echo $row['WeaponDly']; ?>" /></td>
<td><input type="text" name="weapontype" size=15 value="<? echo $row['WeaponType']; ?>" /></td>
<td><input type="checkbox" name="earslot" <? echo ($row['earslot'] ? 'checked="checked"' : ''); ?> /></td>
<td><input type="checkbox" name="neckslot" <? echo ($row['neckslot'] ? 'checked="checked"' : ''); ?> /></td>
<td><input type="checkbox" name="headslot" <? echo ($row['headslot'] ? 'checked="checked"' : ''); ?> /></td>
<td><input type="checkbox" name="faceslot" <? echo ($row['faceslot'] ? 'checked="checked"' : ''); ?> /></td>
<td><input type="checkbox" name="chestslot" <? echo ($row['chestslot'] ? 'checked="checked"' : ''); ?> /></td>
<td><input type="checkbox" name="backslot" <? echo ($row['backslot'] ? 'checked="checked"' : ''); ?> /></td>
<td><input type="checkbox" name="armslot" <? echo ($row['armslot'] ? 'checked="checked"' : ''); ?> /></td>
<td><input type="checkbox" name="shoulderslot" <? echo ($row['shoulderslot'] ? 'checked="checked"' : ''); ?> /></td>
<td><input type="checkbox" name="wristslot" <? echo ($row['wristslot'] ? 'checked="checked"' : ''); ?> /></td>
<td><input type="checkbox" name="waistslot" <? echo ($row['waistslot'] ? 'checked="checked"' : ''); ?> /></td>
<td><input type="checkbox" name="handslot" <? echo ($row['handslot'] ? 'checked="checked"' : ''); ?> /></td>
<td><input type="checkbox" name="fingerslot" <? echo ($row['fingerslot'] ? 'checked="checked"' : ''); ?> /></td>
<td><input type="checkbox" name="legslot" <? echo ($row['legslot'] ? 'checked="checked"' : ''); ?> /></td>
<td><input type="checkbox" name="feetslot" <? echo ($row['feetslot'] ? 'checked="checked"' : ''); ?> /></td>
<td><input type="checkbox" name="prislot" <? echo ($row['prislot'] ? 'checked="checked"' : ''); ?> /></td>
<td><input type="checkbox" name="secslot" <? echo ($row['secslot'] ? 'checked="checked"' : ''); ?> /></td>
<td><input type="checkbox" name="rangeslot" <? echo ($row['rangeslot'] ? 'checked="checked"' : ''); ?> /></td>
<td><input type="checkbox" name="ammoslot" <? echo ($row['ammoslot'] ? 'checked="checked"' : ''); ?> /></td>
<td><input type="checkbox" name="charmslot" <? echo ($row['charmslot'] ? 'checked="checked"' : ''); ?> /></td>
<td><input type="checkbox" name="aug2slot" <? echo ($row['aug2slot'] ? 'checked="checked"' : ''); ?> /></td>
<td><input type="checkbox" name="aug3slot" <? echo ($row['aug3slot'] ? 'checked="checked"' : ''); ?> /></td>
<td><input type="checkbox" name="aug5slot" <? echo ($row['aug5slot'] ? 'checked="checked"' : ''); ?> /></td>
<td><input type="text" name="Mob" size=80 value="<? echo $row['mob']; ?>" /></td>
<td><input type="checkbox" name="brdclass" <? echo ($row['brdclass'] ? 'checked="checked"' : ''); ?> /></td>
<td><input type="checkbox" name="bstclass" <? echo ($row['bstclass'] ? 'checked="checked"' : ''); ?> /></td>
<td><input type="checkbox" name="clrclass" <? echo ($row['clrclass'] ? 'checked="checked"' : ''); ?> /></td>
<td><input type="checkbox" name="druclass" <? echo ($row['druclass'] ? 'checked="checked"' : ''); ?> /></td>
<td><input type="checkbox" name="encclass" <? echo ($row['encclass'] ? 'checked="checked"' : ''); ?> /></td>
<td><input type="checkbox" name="magclass" <? echo ($row['magclass'] ? 'checked="checked"' : ''); ?> /></td>
<td><input type="checkbox" name="mnkclass" <? echo ($row['mnkclass'] ? 'checked="checked"' : ''); ?> /></td>
<td><input type="checkbox" name="necclass" <? echo ($row['necclass'] ? 'checked="checked"' : ''); ?> /></td>
<td><input type="checkbox" name="palclass" <? echo ($row['palclass'] ? 'checked="checked"' : ''); ?> /></td>
<td><input type="checkbox" name="rngclass" <? echo ($row['rngclass'] ? 'checked="checked"' : ''); ?> /></td>
<td><input type="checkbox" name="rogclass" <? echo ($row['rogclass'] ? 'checked="checked"' : ''); ?> /></td>
<td><input type="checkbox" name="shdclass" <? echo ($row['shdclass'] ? 'checked="checked"' : ''); ?> /></td>
<td><input type="checkbox" name="shmclass" <? echo ($row['shmclass'] ? 'checked="checked"' : ''); ?> /></td>
<td><input type="checkbox" name="warclass" <? echo ($row['warclass'] ? 'checked="checked"' : ''); ?> /></td>
<td><input type="checkbox" name="wizclass" <? echo ($row['wizclass'] ? 'checked="checked"' : ''); ?> /></td>
<td><input name="update" type="submit" id=<? echo ($row['id']); ?> value="Update"</td>
</tr>
<?
}
?>
</form>
</table>

That is the search result script. The update script i have set up to echo to the screen the data.

Code:
<?php
    if(isset($_POST['update']))
    {
    $con = mysql_connect("localhost","ketocon_quila","mischief");
    if (!$con) {
            die('Could not connect: ' . mysql_error());
    }
    mysql_select_db("ketocon_quila", $con); 
    $id = $_POST['id'];
        $soditemid = $_POST['soditemid'];
    $tier = $_POST['Tier'];
    $itemname = $_POST['ItemName'];
    $itemac = $_POST['AC'];
    $itemstr = $_POST['STR'];
    $itemsta = $_POST['STA'];
    $itemdex = $_POST['DEX'];
    $itemagi = $_POST['AGI'];
    $itemcha = $_POST['CHA'];
    $itemwis = $_POST['WIS'];
    $itemint = $_POST['INT'];
    $itemhp = $_POST['HP'];
    $itemmana = $_POST['Mana'];
    $itemmr = $_POST['MR'];
    $itemfr = $_POST['FR'];
    $itemcr = $_POST['CR'];
    $itempr = $_POST['PR'];
    $itemdr = $_POST['DR'];
    $itemft = $_POST['FT'];
    $itemcs = $_POST['CS'];
    $itemms = $_POST['MS'];
    $itemsr = $_POST['SR'];
    $itemdmgr = $_POST['DmgR'];
    $itemaggr = $_POST['Aggr'];
    $itemsw = $_POST['SpellWard'];
    $instrument = $_POST['Instrument'];
    $instrumentmod = $_POST['InstrumentMod'];
    $banetype = $_POST['BaneType'];
    $banedmg = $_POST['BaneDmg'];
    $skillmod = $_POST['SkillMod'];
    $skillmodamt = $_POST['SkillModAmt'];
    $focuseffect = $_POST['FocusEffect'];
    $spelleffect = $_POST['SpellEffect'];
    $weapondmg = $_POST['WeaponDmg'];
    $weapondly = $_POST['WeaponDly'];
    $weapontype = $_POST['WeaponType'];
    $earslot = $_POST['earslot'];
    $neckslot = $_POST['neckslot'];
    $headslot = $_POST['headslot'];
    $faceslot = $_POST['faceslot'];
    $chestslot = $_POST['chestslot'];
    $backslot = $_POST['backslot'];
    $armslot = $_POST['armslot'];
    $shoulderslot = $_POST['shoulderslot'];
    $wristslot = $_POST['wristslot'];
    $waistslot = $_POST['waistslot'];
    $handslot = $_POST['handslot'];
    $fingerslot = $_POST['fingerslot'];
    $legslot = $_POST['legslot'];
    $feetslot = $_POST['feetslot'];
    $prislot = $_POST['prislot'];
    $secslot = $_POST['secslot'];
    $rangeslot = $_POST['rangeslot'];
    $ammoslot = $_POST['ammoslot'];
    $charmslot = $_POST['charmslot'];
    $aug2slot = $_POST['aug2slot'];
    $aug3slot = $_POST['aug3slot'];
    $aug5slot = $_POST['aug5slot'];
    $mob = $_POST['mob'];
    $brdclass = $_POST['brdclass'];
    $bstclass = $_POST['bstclass'];
    $clrclass = $_POST['clrclass'];
    $druclass = $_POST['druclass'];
    $encclass = $_POST['encclass'];
    $magclass = $_POST['magclass'];
    $mnkclass = $_POST['mnkclass'];
    $necclass = $_POST['necclass'];
    $palclass = $_POST['palclass'];
    $rngclass = $_POST['rngclass'];
    $rogclass = $_POST['rogclass'];
    $shdclass = $_POST['shdclass'];
    $shmclass = $_POST['shmclass'];
    $warclass = $_POST['warclass'];
    $wizclass = $_POST['wizclass'];
    echo    "UPDATE Items2 SET id = $id
                                                                        soditemid = $soditemid,
                                    Tier = $tier,
                                    ItemName = '$itemname',
                                    AC = $itemac,
                                    STR = $itemstr,
                                    STA = $itemsta,
                                    DEX = $itemdex,
                                    AGI = $itemagi,
                                    CHA = $itemcha,
                                    WIS = $itemwis,
                                    `INT` = $itemint,
                                    HP = $itemhp,
                                    Mana = $itemmana,
                                    MR = $itemmr,
                                    FR = $itemfr,
                                    CR = $itemcr,
                                    PR = $itempr,
                                    DR = $itemdr,
                                    FT = $itemft,
                                    CS = $itemcs,
                                    MS = $itemms,
                                    SR = $itemsr,
                                    DmgR = $itemdmgr,
                                    Aggr = $itemaggr,
                                    SpellWard = $itemsw,
                                    Instrument = '$instrument',
                                    InstrumentMod = $instrumentmod,
                                    BaneType = '$banetype',
                                    BaneDmg = $banedmg,
                                    SkillMod = '$skillmod',
                                    SkillModAmt = $skillmodamt,
                                    FocusEffect = '$focuseffect',
                                    SpellEffect = '$spelleffect',
                                    WeaponDmg = $weapondmg,
                                    WeaponDly = $weapondly,
                                    WeaponType = '$weapontype',
                                    earslot = $earslot,
                                    neckslot = $neckslot,
                                    headslot = $headslot,
                                    faceslot = $faceslot,
                                    chestslot = $chestslot,
                                    backslot = $backslot,
                                    armslot = $armslot,
                                    shoulderslot = $shoulderslot,
                                    wristslot = $wristslot,
                                    waistslot = $waistslot,
                                    handslot = $handslot,
                                    fingerslot = $fingerslot,
                                    legslot = $legslot,
                                    feetslot = $feetslot,
                                    prislot = $prislot,
                                    secslot = $secslot,
                                    rangeslot = $rangeslot,
                                    ammoslot = $ammoslot,
                                    charmslot = $charmslot,
                                    aug2slot = $aug2slot,
                                    aug3slot = $aug3slot,
                                    aug5slot = $aug5slot,
                                    mob = '$mob',
                                    brdclass = $brdclass,
                                    bstclass = $bstclass,
                                    clrclass = $clrclass,
                                    druclass = $druclass,
                                    encclass = $encclass,
                                    magclass = $magclass,
                                    mnkclass = $mnkclass,
                                    necclass = $necclass,
                                    palclass = $palclass,
                                    rngclass = $rngclass,
                                    rogclass = $rogclass,
                                    shdclass = $shdclass,
                                    shmclass = $shmclass,
                                    warclass = $warclass,
                                    wizclass = $wizclass,
                                    WHERE id = $id";
     
     
     
    echo "Updated data successfully\n";
    mysql_close($con);
    }
?>

When I click Update, this is the result:

UPDATE Items2 SET id = soditemid = 0, Tier = , ItemName = '', AC = , STR = , STA = , DEX = , AGI = , CHA = , WIS = , `INT` = , HP = , Mana = , MR = , FR = , CR = , PR = , DR = , FT = , CS = , MS = , SR = , DmgR = , Aggr = , SpellWard = , Instrument = '', InstrumentMod = , BaneType = '', BaneDmg = , SkillMod = '', SkillModAmt = , FocusEffect = '', SpellEffect = '', WeaponDmg = , WeaponDly = , WeaponType = '', earslot = on, neckslot = , headslot = , faceslot = , chestslot = , backslot = , armslot = , shoulderslot = , wristslot = , waistslot = , handslot = , fingerslot = , legslot = , feetslot = , prislot = , secslot = , rangeslot = , ammoslot = , charmslot = , aug2slot = , aug3slot = , aug5slot = , mob = '', brdclass = , bstclass = , clrclass = on, druclass = on, encclass = on, magclass = on, mnkclass = , necclass = on, palclass = , rngclass = , rogclass = , shdclass = , shmclass = on, warclass = , wizclass = on, WHERE id = Updated data successfully

As you can see, most of the datatypes are returning null values. There should always be an ItemName and id most everything else is optional.
Speedy
(13 items)
 
  
CPUMotherboardGraphicsRAM
Intel Core i7 920 EX58-UD4P NVIDIA GeForce GTX 285 Corsair  
Hard DriveCoolingOSMonitor
Seagate Barracuda CM Hyper 212+ Ubuntu 12.04 w/KDE 25.6" Hanns-G 
KeyboardPowerCaseMouse
Saitek Eclipse II Corsair 750 Watt Antec 902 Logitech Wireless Trackball 
  hide details  
Reply
Speedy
(13 items)
 
  
CPUMotherboardGraphicsRAM
Intel Core i7 920 EX58-UD4P NVIDIA GeForce GTX 285 Corsair  
Hard DriveCoolingOSMonitor
Seagate Barracuda CM Hyper 212+ Ubuntu 12.04 w/KDE 25.6" Hanns-G 
KeyboardPowerCaseMouse
Saitek Eclipse II Corsair 750 Watt Antec 902 Logitech Wireless Trackball 
  hide details  
Reply
post #2 of 6
I'm confused. You don't seem to be actually $_POST'ing the form fields. Could you explain the setup a bit more? Are those 2 scripts on the same page?
:3
(10 items)
 
   
CPUMotherboardGraphicsRAM
2600k Asus P8Z77-I Deluxe GTX 680 2GB 16GB Corsair vengeance  
Hard DriveOSMonitorPower
2x 250GB HyperX Windows 7 SP1 x64 Benq G2420HD XFX 650W 
CaseAudio
lian li pc-q08b On-board 
CPUMotherboardGraphicsRAM
phenom II X4 955 C3 @ 4.2ghz 1.4v ASUS M4A79T Deluxe Radeon HD 5870 crossfire 940/1300 8GB corsair ddr3 1600mhz 7-8-7-20@1.75v 
Hard DriveCoolingCoolingOS
120GB Kingston HyperX SSD, 250gb HDD x3 +660Gb 5870 Accelero Xtreme Corsair H100  win 7 ultimate 64bit (stipped to bone) 
MonitorPowerCase
Benq G2420HD XFX Pro 650W (sleeved) (seasonic in disguise) Bitfenix Colossus 
  hide details  
Reply
:3
(10 items)
 
   
CPUMotherboardGraphicsRAM
2600k Asus P8Z77-I Deluxe GTX 680 2GB 16GB Corsair vengeance  
Hard DriveOSMonitorPower
2x 250GB HyperX Windows 7 SP1 x64 Benq G2420HD XFX 650W 
CaseAudio
lian li pc-q08b On-board 
CPUMotherboardGraphicsRAM
phenom II X4 955 C3 @ 4.2ghz 1.4v ASUS M4A79T Deluxe Radeon HD 5870 crossfire 940/1300 8GB corsair ddr3 1600mhz 7-8-7-20@1.75v 
Hard DriveCoolingCoolingOS
120GB Kingston HyperX SSD, 250gb HDD x3 +660Gb 5870 Accelero Xtreme Corsair H100  win 7 ultimate 64bit (stipped to bone) 
MonitorPowerCase
Benq G2420HD XFX Pro 650W (sleeved) (seasonic in disguise) Bitfenix Colossus 
  hide details  
Reply
post #3 of 6
Thread Starter 
This is for a game to track Item records. I data entry done and it works fine, it plugs in the data to the table with no problems. What I'm trying to do here is use a form to edit/change existing records (in case of typos)

I have 2 scripts there, the result of searching for items into a form using text and check boxes so they can be edited and updated from that form. the Update script is the one that is echoing the mysql query instead of actually running it. Check boxes all come through fine, but the rest of the values all get set to nothing.

I'm new to PHP and fairly new to MySQL so I'm probably making this harder than it has to be.
Speedy
(13 items)
 
  
CPUMotherboardGraphicsRAM
Intel Core i7 920 EX58-UD4P NVIDIA GeForce GTX 285 Corsair  
Hard DriveCoolingOSMonitor
Seagate Barracuda CM Hyper 212+ Ubuntu 12.04 w/KDE 25.6" Hanns-G 
KeyboardPowerCaseMouse
Saitek Eclipse II Corsair 750 Watt Antec 902 Logitech Wireless Trackball 
  hide details  
Reply
Speedy
(13 items)
 
  
CPUMotherboardGraphicsRAM
Intel Core i7 920 EX58-UD4P NVIDIA GeForce GTX 285 Corsair  
Hard DriveCoolingOSMonitor
Seagate Barracuda CM Hyper 212+ Ubuntu 12.04 w/KDE 25.6" Hanns-G 
KeyboardPowerCaseMouse
Saitek Eclipse II Corsair 750 Watt Antec 902 Logitech Wireless Trackball 
  hide details  
Reply
post #4 of 6
Right, I see. Well, you cannot define those PHP variables with that HTML form, sadly.

You can only use $_POST if the variables were actually $_POST'ed to the recieving PHP file. That's what PHP forms are for, e.g.
Code:
<?php
<form action="somepage.php" method="post">
Example1: <input type="text" name="example1" />
Example2: <input type="text" name="example2" />
<input type="submit" />

Then on somepage.php, I would receive them with:
Code:
$example1 = $_POST['example1']

As you seem to already know how to do.

$_GET is less fussy, you can put all your variables in the URL and $_GET them all. Like:
Code:
site.com/?example1=Hello!
<?php
$example1 = $_GET['example1']
?>

My point is, you can't mix HTML variables with PHP variables thumb.gif
:3
(10 items)
 
   
CPUMotherboardGraphicsRAM
2600k Asus P8Z77-I Deluxe GTX 680 2GB 16GB Corsair vengeance  
Hard DriveOSMonitorPower
2x 250GB HyperX Windows 7 SP1 x64 Benq G2420HD XFX 650W 
CaseAudio
lian li pc-q08b On-board 
CPUMotherboardGraphicsRAM
phenom II X4 955 C3 @ 4.2ghz 1.4v ASUS M4A79T Deluxe Radeon HD 5870 crossfire 940/1300 8GB corsair ddr3 1600mhz 7-8-7-20@1.75v 
Hard DriveCoolingCoolingOS
120GB Kingston HyperX SSD, 250gb HDD x3 +660Gb 5870 Accelero Xtreme Corsair H100  win 7 ultimate 64bit (stipped to bone) 
MonitorPowerCase
Benq G2420HD XFX Pro 650W (sleeved) (seasonic in disguise) Bitfenix Colossus 
  hide details  
Reply
:3
(10 items)
 
   
CPUMotherboardGraphicsRAM
2600k Asus P8Z77-I Deluxe GTX 680 2GB 16GB Corsair vengeance  
Hard DriveOSMonitorPower
2x 250GB HyperX Windows 7 SP1 x64 Benq G2420HD XFX 650W 
CaseAudio
lian li pc-q08b On-board 
CPUMotherboardGraphicsRAM
phenom II X4 955 C3 @ 4.2ghz 1.4v ASUS M4A79T Deluxe Radeon HD 5870 crossfire 940/1300 8GB corsair ddr3 1600mhz 7-8-7-20@1.75v 
Hard DriveCoolingCoolingOS
120GB Kingston HyperX SSD, 250gb HDD x3 +660Gb 5870 Accelero Xtreme Corsair H100  win 7 ultimate 64bit (stipped to bone) 
MonitorPowerCase
Benq G2420HD XFX Pro 650W (sleeved) (seasonic in disguise) Bitfenix Colossus 
  hide details  
Reply
post #5 of 6
Quote:
Originally Posted by JY View Post

My point is, you can't mix HTML variables with PHP variables thumb.gif

Actually you can but it is SO frowned upon that anybody doing it should be shot and so, well... you're right anyway! tongue.gif
Ol' Sandy
(28 items)
 
"Zeus"
(12 items)
 
Elite Preview
(6 items)
 
CPUMotherboardGraphicsRAM
Intel Xeon E3-1230v3 Gigabyte GA-Z97X-UD5H-BK MSI Gaming GTX 980 Kingston 32GB (4x8) 
Hard DriveHard DriveHard DriveHard Drive
Plextor PX-256M5S 256GB Samsung EVO 1TB Hitachi HDS721010CLA332 Hitachi HDS723020BLA642 
Hard DriveHard DriveHard DriveOptical Drive
Hitachi HDS723020BLA642 Hitachi HUA722010CLA330 WDC WD10EARS-00Z5B1 TSSTcorp CDDVDW SH-S223B 
CoolingCoolingOSMonitor
Phanteks PH-TC14PE with TY-140's Lamptron FCv5 (x2) Windows 8 Pro 64-bit Dell U2412M 
MonitorMonitorMonitorKeyboard
Dell U2412M Dell U2212HM Dell U2713HM Topre Realforce 87UB | Ducky DK9087 G2 Pro 
PowerCaseMouseMouse Pad
Corsair AX-750 Corsair Obsidian 650D Logitech G700 XTRAC Ripper XXL 
AudioAudioAudioAudio
Beyerdynamic DT-770 Pro 250ohm Schiit Bifrost DAC Schiit Asgard 2 HiVi Swan M50W 2.1 
CPUMotherboardRAMHard Drive
Intel Xeon E5-2620 Super Micro X9SRL-F-B 128GB 1333MHz LSI 9271-8i 
OSPowerCase
VMware ESXi 5.5 SeaSonic SS-400FL2 Fractal Define R3 
CPUMotherboardGraphicsRAM
Intel Core i5-3437U HP EliteBook Folio 9470m  Intel HD Graphics 4000  16GB DDR3 SDRAM 
Hard DriveOS
256GB SSD Windows 10 Insider Preview 
  hide details  
Reply
Ol' Sandy
(28 items)
 
"Zeus"
(12 items)
 
Elite Preview
(6 items)
 
CPUMotherboardGraphicsRAM
Intel Xeon E3-1230v3 Gigabyte GA-Z97X-UD5H-BK MSI Gaming GTX 980 Kingston 32GB (4x8) 
Hard DriveHard DriveHard DriveHard Drive
Plextor PX-256M5S 256GB Samsung EVO 1TB Hitachi HDS721010CLA332 Hitachi HDS723020BLA642 
Hard DriveHard DriveHard DriveOptical Drive
Hitachi HDS723020BLA642 Hitachi HUA722010CLA330 WDC WD10EARS-00Z5B1 TSSTcorp CDDVDW SH-S223B 
CoolingCoolingOSMonitor
Phanteks PH-TC14PE with TY-140's Lamptron FCv5 (x2) Windows 8 Pro 64-bit Dell U2412M 
MonitorMonitorMonitorKeyboard
Dell U2412M Dell U2212HM Dell U2713HM Topre Realforce 87UB | Ducky DK9087 G2 Pro 
PowerCaseMouseMouse Pad
Corsair AX-750 Corsair Obsidian 650D Logitech G700 XTRAC Ripper XXL 
AudioAudioAudioAudio
Beyerdynamic DT-770 Pro 250ohm Schiit Bifrost DAC Schiit Asgard 2 HiVi Swan M50W 2.1 
CPUMotherboardRAMHard Drive
Intel Xeon E5-2620 Super Micro X9SRL-F-B 128GB 1333MHz LSI 9271-8i 
OSPowerCase
VMware ESXi 5.5 SeaSonic SS-400FL2 Fractal Define R3 
CPUMotherboardGraphicsRAM
Intel Core i5-3437U HP EliteBook Folio 9470m  Intel HD Graphics 4000  16GB DDR3 SDRAM 
Hard DriveOS
256GB SSD Windows 10 Insider Preview 
  hide details  
Reply
post #6 of 6
Thread Starter 
Thank you that did it. I'm a newb to PHP but just learned a valuable lesson! +rep
Speedy
(13 items)
 
  
CPUMotherboardGraphicsRAM
Intel Core i7 920 EX58-UD4P NVIDIA GeForce GTX 285 Corsair  
Hard DriveCoolingOSMonitor
Seagate Barracuda CM Hyper 212+ Ubuntu 12.04 w/KDE 25.6" Hanns-G 
KeyboardPowerCaseMouse
Saitek Eclipse II Corsair 750 Watt Antec 902 Logitech Wireless Trackball 
  hide details  
Reply
Speedy
(13 items)
 
  
CPUMotherboardGraphicsRAM
Intel Core i7 920 EX58-UD4P NVIDIA GeForce GTX 285 Corsair  
Hard DriveCoolingOSMonitor
Seagate Barracuda CM Hyper 212+ Ubuntu 12.04 w/KDE 25.6" Hanns-G 
KeyboardPowerCaseMouse
Saitek Eclipse II Corsair 750 Watt Antec 902 Logitech Wireless Trackball 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Web Coding
Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Web Coding › PHP HTML & MySQL not updating records on edit