View Single Post
Old 09-25-2012, 04:38 AM   PM User | #1
Iggy0828
New Coder

 
Join Date: Sep 2012
Posts: 12
Thanks: 2
Thanked 0 Times in 0 Posts
Iggy0828 is an unknown quantity at this point
MySQL Updating using HTML form and PHP

I'm now trying to update data using a form, this is the update script. Unfortunately the things I update do not take effect. Everything else stays the same though.

Code:
    <?php
    if(isset($_POST['update']))
    {
    $con = mysql_connect("localhost","username","password");
    if (!$con) {
            die('Could not connect: ' . mysql_error());
    }
     
    $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'];
    mysql_select_db("ketocon_quila", $con);
    mysql_query(    "UPDATE Items2 SET 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'") or die('Error updating; ' . mysql_error());
     
     
     
    echo "Updated data successfully\n";
    mysql_close($con);
    }
    ?>
Iggy0828 is offline   Reply With Quote