<?php
include("connection.php");
$sql="UPDATE detail SET 'user_name'='".$_POST['user_name']."','password'='".$_POST['password']."' WHERE 'id'='".$_GET['id']."'";
$result=mysql_query($sql);
mysql_fetch_array($result);
?>

<html>
<head>

<title>login</title>
</head>

<body>
<form method="post" action="index.php?id=<?php $_GET['id']; ?>">
id:<input type="text" name="id" value="<?php echo $_POST['id']; ?>" /><br/>
user_name:<input type="text" name="user_name" value="<?php echo $_POST['user_name']; ?>" /><br/>
password:<input type="password" name="password" value="<?php echo $_POST['password']; ?>"/><br/>
<input type="submit" value="submit" />
</form>
</body>
</html>

Error? Reason for posting? Although the $sql looks like it wont work is that correct?

Member Avatar for diafol

@monish

Unless you supply a question, how can you expect an answer?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.