Hi guys
I have a registration form working fine, my database is as below:
userid
username
email
password
repeatpassword
I have added another column which is "name", users can update their profile once they have logged in so I have created updateprofile.php and when I login-->go to update profile and insert my name nothing adds to mysql name column
this is my code below:
<?php
include ("global.php");
//username session
$_SESSION['username']=='$username';
$username=$_SESSION['username'];
//welcome messaage
echo "Welcome, " .$_SESSION['username']."!<p>";
if ($_POST['register'])
{
//get form data
$name = addslashes(strip_tags($_POST['name']));
$update = mysql_query("INSERT INTO users (name) VALUES ('$_POST[name]') WHERE username='$username'");
}
?>
<form action='updateprofile.php' method='POST'>
Company Name:<br />
<input type='text' name='name'><p />
<input type='submit' name='register' value='Register'>
</form>
can you please tell me where in this code is wrong? Im new in php so please excuse me if I have silly mistakes.
thanks in advance