I have no problem connecting to database, and the form is okay i guess. ¿Do anybody see the problem in here? It keeps returning me ERROR!
PHP code:
<?php
mysql_connect("$host", "$mysql_user", "$mysql_pass")or die("Error connecting.");
mysql_select_db(users)or die("Can't access to database.");
if($id) {
$sql = 'UPDATE members SET ';
$sql .= 'username="'.$username.'",';
$sql .= 'email="'.$email.'",';
$sql .= 'name="'.$name.'",';
$sql .= 'fullname="'.$fullname.'",';
$sql .= 'sex="'.$sex.'",';
$sql .= 'phone="'.$phone.'",';
$sql .= 'phone2="'.$phone2.'",';
$sql .= 'mobile="'.$mobile.'",';
$sql .= 'country="'.$country.'",';
$sql .= 'state="'.$state.'",';
$sql .= 'postalcode="'.$postalcode.'",';
$sql .= ' WHERE id="'.$id.'"';
if (mysql_query($sql)) {
echo 'Done!';
} else {
echo 'ERROR!';
}
mysql_close();
} else {
echo 'There is no id';
};
?>
HTML FORM CODE:
<form action="'.$u_a.'edituser" method="post" id="edit_user" enctype="multipart/form-data" >
<input name="id" value="" type="hidden" >
<input name="username" value="" type="text" >
<input name="password" value="" type="text" >
<input name="name" value="" type="text" >
<input name="fullname" value="" type="text" >
<input name="email" value="" type="text" >
<input name="phone" value="" type="text" >
<input name="mobile" value="" type="text" >
<input name="phone2" value="" type="text" >
<input name="country" value="" type="text" >
<input name="state" value="" type="text" >
<input name="postalcode" value="" type="text" >
<input value="Send" type="submit" >
</form>