I've gotten the variables I need into a page and used $_GET to call them.
Now I'm trying to process a form that reloads the same page and does asql update on submit.
But I can't get the variables I need in the $sql_update statement.
<?php
//Call Database & Connect
require_once('headers/database.php');
connect();
if(isset($_POST['submit'])){
$nickname=$_POST['nickname'];
$sql_update = "UPDATE logins SET nickname = '$nickname' WHERE user_id='$_GET[user_id]' AND site='$_GET[site]'";
mysql_query($sql_update) or die(mysql_error());
} else {
$sql_edit = "SELECT * FROM logins WHERE user_id='$_GET[user_id]' AND site='$_GET[site]'";
$result = mysql_query($sql_edit) or die(mysql_error());
while($row = mysql_fetch_array($result)){ ?>
<form method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>?user_id=$row[user_id]&site=$row[site]">
<table>
<tr><td>Site</td><td>Nickname</td><td>Username</td><td>Password</td></tr>
<tr><td><?php echo $row['site']; ?></td><td><input type="text" name="nickname" value="<?php echo $row['nickname']; ?>"></td><td><input type="text" name="username" value="<?php echo $row['username']; ?>" autocomplete="off"></td><td><input type="password" name="password" value="<?php echo $row['password']; ?>" autocomplete="off"></td><td><input type="submit" name="submit" value="Update"></td></tr>
</table>
</form>
<?php
}
}
?>
What am I missing?