SA-MP Forums Archive
PHP/MySQL help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Other (https://sampforum.blast.hk/forumdisplay.php?fid=7)
+--- Forum: Everything and Nothing (https://sampforum.blast.hk/forumdisplay.php?fid=23)
+--- Thread: PHP/MySQL help (/showthread.php?tid=302939)



PHP/MySQL help - GamingTurf - 11.12.2011

I have been changing this around for hours, i can't seem to get it to work .. It does not set the player's name. Database is correct and everything. >.> What's wrong?

PHP код:
<tr CLASS='MYTABLE'>
                    <
td CLASS='MYTABLE' height=40 width=80>Username</td>
                    <
td CLASS='MYTABLE'><input name='newuser' type='text' value='$user'></td>
        
                  </
tr>
                  <
tr CLASS='MYTABLE'>
                    <
td CLASS='MYTABLE' height=40 width=80>Password</td>
                    <
td CLASS='MYTABLE'><input name='password' type='text' value='$pass'></td>
        
                  </
tr>
                  <
tr CLASS='MYTABLE'>
                    <
td CLASS='MYTABLE' height=40>Callsign</td>
                    <
td CLASS='MYTABLE'><input name='callsign' type='text' value='$kills'></td>
                    
                  </
tr>
                  <
tr CLASS='MYTABLE'>
                    <
td CLASS='MYTABLE' height=40>Andromada Flights</td>
                    <
td CLASS='MYTABLE'><input name='androf' type='text' value='$deaths'></td>
                    
                  </
tr>
                  <
tr CLASS='MYTABLE'>
                    <
td CLASS='MYTABLE' height=40>Total Score</td>
                    <
td CLASS='MYTABLE'><input name='totalscore' type='text' value='$score'></td>
                    
                  </
tr>
                  <
tr CLASS='MYTABLE'>
                    <
td CLASS='MYTABLE' height=40>Money</td>
                    <
td CLASS='MYTABLE'><input name='money' type='text' value='$money'></td>
                  </
tr>
                  <
tr CLASS='MYTABLE'>
                    <
td CLASS='MYTABLE' height=40>Admin Level</td>
                    <
td CLASS='MYTABLE'><input name='adminlevel' type='text' value='$admin'></td>
                  </
tr>
                  <
tr CLASS='MYTABLE'>
                    <
td CLASS='MYTABLE' height=40>Email Address</td>
                    <
td CLASS='MYTABLE'><input name='emailaddress' type='text' value='$email'></td>
                  </
tr>
                  <
tr CLASS='MYTABLE'>
                    <
td CLASS='MYTABLE' height=40>IP</td>
                    <
td CLASS='MYTABLE'><input name='ip' type='text' value='$ip'></td>
                  </
tr>
                  <
tr CLASS='MYTABLE'>
                    <
td CLASS='MYTABLE' height=40>Banned</td>
                    <
td CLASS='MYTABLE'><input name='banned' type='text' value='$banned'  readonly='true'></td>
                  </
tr>
                </
table><input name='hvalue' type='hidden' value='$user'><input name='submit' type='submit' value='   Submit   ' ></form></center>";
              }
          }
          }
          if(isset(
$_POST['hvalue']))
          {
                  
$newuser = htmlentities(mysql_escape_string($_POST['newuser']));
                  
$pass = htmlentities(mysql_escape_string($_POST['password']));
                  
$kills = htmlentities(mysql_escape_string($_POST['callsign']));
                  
$deaths = $_POST['androf'];
                  
$score = $_POST['totalscore'];
                  
$money = $_POST['money'];
                  
$admin = $_POST['adminlevel'];
                  
$email = htmlentities(mysql_escape_string($_POST['emailaddress']));
                  
$ip = $_POST['ip'];
                  mysql_query("
UPDATE users SET username='$newuser' WHERE username '$user'");
                  echo "
$user's information has been updated! Redirecting momenterially. <meta http-equiv='REFRESH' content='5;url=adminpage.php'>"; 



Re: PHP/MySQL help - THE_KNOWN - 11.12.2011

mysql_query("UPDATE users SET username='".$newuser."' WHERE username = '".$user."'"); ?

im a noob sorry :/