Originally Posted by
Anirban1987
Now my question is how can that HTML form identifies the sql row's id and force the processor file (i.e. the file which is updating the DB by processing the form) to modify the particular cell in the row in which the form resides.
The syntax of an SQL insert query is like this: (using your table from the screenshot)
PHP Code:
Insert into [table_name] Values('','$feedback','$email','$time','','$act_taken');
---
Now the way you are processing your form is all wrong. The HTML form contains inputs. Each input has a name as an identifier. You are using the post method. So...
$_POST[] is a standard PHP array. It stores values from a form using the post method. All data stored in this array can be accessed using an associative index.
E.g.
Code:
<form method="post" action="$_SERVER['PHP_SELF']>
<input type="text" name="username" value="" size="30"/>
</form>
Code:
<?php
if(isset($_POST['username']) && $_POST['username'] != '')
{
$username = $_POST['username'];
// ...
}
?>
It can be referenced pretty easily. One of your mistakes seems to be that the Action name is on all your inputs. This would simply overwrite the previous one. Which leaves you with one input trying to be inserted into the database and you get your errors. :-)
So your solution is to assign unique names to your form inputs. Such as name="feedback" and name="email". Then you can work with each variable and process them as you see fit.
On a final note, the query from before (see below). The first value to be entered is the id, you can input it manually or you can leave it blank like I have and the database will fill it in with the next logical value (assuming auto increment has been setup).
PHP Code:
... Values('','$feedback ...