Well I am new to coding,What I am trying is to update data in database through Php .I am trying hard to update data but i don't know where is problem coming ,there is no error too.My first file is
"ppp.html"
<html>
<form action="l.php"method="post">
<input type ="text" name ="complaint">
</input>
<input type="submit"></input>
</html>
Now my "L.php " It also don't show any error .It goes through easily
<?php
$complaint="";
if(
isset($_POST['complaint']))
{$complaint =$_POST['complaint'];}
mysql_connect("localhost","root","") or die ("couldnt attack ");
mysql_select_db("site")or die('i surrender');
$query=("SELECT * FROM site2 where category='$complaint'") or die("couldnt select");
$result=mysql_query($query) or die ('hghyt');
while ($complaint= mysql_fetch_array($result))
{
echo"<td>".'<br>'.$complaint['category']."</tr>";
ECHO"<TR>"."<A HREF='update.php'>"."UPDATE"."</A>";
echo "<br/>";
ECHO"</table>";
}
?>
Sorry for very wrong query and very inappropriate way of coding but I am learning it all by myself through internet Now my "update.php file"
<html>
<form action="update1.php" method="post">
<input type= "text" name="blue"></input>
<input type= "submit"></input>
</form>
</html>
It also goes of in easy way,and don't show any problem ,now my last file "update1.php"
<?php
$complaint="";
if(isset ($_POST['complaint']))
{$complaint =$_POST['complaint'];}
$blue="";
if(isset ($_POST['blue']))
{$blue =$_POST['blue'];}
mysql_connect("localhost","root","") or die ("couldnyt coibnovdbs");
mysql_select_db("site") or die ("no databse");
$query=("update site2 set category='$blue' where category ='$complaint'") or die ("couldnt attack");
$result=mysql_query($query) or die("kjkk");
?>
Please help me .It is bothering me,I cant find any solution for it.I think problem is in last file only but it is not showing any errors.
Thank you