Iam new to php and iam having some problems with my edit user php file. The problem is the query doesnt perform. PLs can some one help me with this code. Thanks in advance.
[php]
<?php session_start(); if(!isset($_SESSION['SESS_LOGIN']) || $_SESSION['SESS_TYPE'] !='admin')// if session variable "login" does not exist. { echo ''; //header("location:login-form.php"); // Re-direct to login-form.php } else { include("config.php"); $id = mysql_real_escape_string($_POST['id']); $login = mysql_real_escape_string($_POST['login']); $password = mysql_real_escape_string($_POST['password']); $type = mysql_real_escape_string($_POST['type']); $qry_edit = " UPDATE members SET login='$login', password='$password', type='$type' WHERE id='$id' "; $count = mysql_query("SELECT COUNT(id) FROM members WHERE id='$id'"); if(mysql_num_rows($count)==1) { if($result=mysql_query($qry_edit)) //or die(mysql_error()); { /*echo '';*/ header("Location: view_all_user.php"); } else { echo "Problem in editing !" ; echo "ERROR - unable to save new username and password!
"; $SQLError = "SQL ERROR: ".mysql_errno().". ".mysql_error()."
"; echo "$SQLError"; mysql_close(); } } //echo "
you have successfully edited one user !
[ username = $login ] " ; else { echo "
No id !" ; } } ?>
[/php]