Not working PHP and Mysql Update code...

Discussion in 'HTML & Website Design' started by Majo0od, Sep 20, 2009.

  1. #1
    Hey guys,
    I set up a form and wanted to have the info inside the form update what is in the database, but its not working, I know its because of the PHP code, here it is:
    <?php
    
    $id=$_GET['Username'];
    $Username=$_POST['Username'];
    $Flashdev=$_POST['Flashdev'];
    $Password=$_POST['Password'];
    $EmailAddress=$_POST['EmailAddress'];
    $Paypal=$_POST['Paypal'];
    $Alertpay=$_POST['Alertpay'];
    $Videos=$_POST['Videos'];
    $Money=$_POST['Money'];
    $ClanLeader=$_POST['ClanLeader'];
    $ClanName=$_POST['ClanName'];
    $InClan=$_POST['InClan'];
    $ClanIMG=$_POST['ClanIMG'];
    $Admin=$_POST['Admin'];
    
    
    $con = mysql_connect("localhost", "*hidden*", "*password hidden*");
    if (!$con)
      {
      die('Could not connect: ' . mysql_error());
      }
    
    mysql_select_db("*hidden*", $con);
    
    $query="UPDATE users SET Username='".mysql_real_escape_string($Username)."', Flashdev ='".mysql_real_escape_string($Flashdev)."', Password ='".mysql_real_escape_string($Pwassword)."', EmailAddress ='".mysql_real_escape_string($EmailAddress)."', Paypal ='".mysql_real_escape_string($Paypal)."', Alerypay ='".mysql_real_escape_string($Alertpay)."', Videos ='".mysql_real_escape_string($Videos)."', Money ='".mysql_real_escape_string($Money)."', ClanLeader ='".mysql_real_escape_string($ClanLeader)."', ClanName ='".mysql_real_escape_string($ClanName)."', ClanIMG ='".mysql_real_escape_string($ClanIMG)."', Admin ='".mysql_real_escape_string($Admin)."' WHERE Username = ".$id;
    mysql_query($query);
    echo "Record Updated";
    mysql_close();
    ?> 
    Code (markup):
    Please help me! I have been working endless hours on figuring out why it isn't working :/
     
    Majo0od, Sep 20, 2009 IP