Hello,
I have got an error when i run this code.My query is updated but when I fetch the query then i got this error mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\wamp\www\html-contact-form-captcha\update.php on line 44
please check the code is given below:-
****
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<table border="1">
<tr>
<th> Name</th>
<th> Active</th>
<th> Last Name</th>
</tr>
<?php
$id=$_POST['id'];
$name=$_POST['name'];
$active=$_POST['active'];
$lastName=$_POST['lastName'];
$db=mysql_connect("localhost","root","");
mysql_select_db("new",$db);
echo $qry="update records set name='$name', active='$active', LastName='$lastName' where id='$id' ";
$result=mysql_query($qry);
while($row=mysql_fetch_array($result)){
echo"<tr>
<td>".$row['name']."</td>
<td>".$row['active']."</td>
<td>".$row['LastName']."</td>
</tr>";
}
echo mysql_error();
?>
</table>
</body>
</html>
****
Please solve this issue asap...thanks in advance..