I have a major problem... I am not able to edit the values and sent it back to the SQL server... am I missing out something??
<form name="form1" action="category.php">
<? $query="SELECT cat_id, category FROM category";
$results=mysql_query($query);
$num_result = mysql_num_rows($results);
for ($i=0; $i<$num_result; $i++)
{$row = mysql_fetch_array($results);
?>
<input type="text" name="<?$id?>" size="5" value="<? echo $row["cat_id"]?>">
<input type="text" name="<?$category?>" size="30" value="<? echo $row["category"]?>">
<input type="button" name="<?$submit2?>" value="Edit">
<input type="button" name="submit3" value="Delete">
<br>
<?
$id=$row["cat_id"];
$category=$row["category"];
if(!isset($category)){
echo "Variable $category has no val";
}
if(!isset($id)){
echo "Variable $id has no value";
}}
if ($submit2[i] == "Edit")
{
$str=NULL;
$update="UPDATE category SET category='$category[i]' where cat_id='$id'";
mysql_query($update);
//document.form.submit();
}