So how should I do the code?
Let's say my form is:
<form action="check.php" method="POST">
<textarea name="ans[0]"> </textarea>
<textarea name="ans[1]"> </textarea>
<textarea name="ans[2]"> </textarea>
<textarea name="ans[3]"> </textarea>
<input type="submit" />
The check.php:
<?php
include('mysql.php'); // in this file i get connected to my db
foreach($ans as $index)
{
//I want to make this to do that:
mysql_query("UPDATE mytable SET $ans = '$ans[1]' WHERE user = 'Me'"); // How do I make that to update $ans[0] for first loop scan, than in next loop scan $ans[1] then $ans[2] and so on...
}
?>
And yes, I'm soo begginer in these stuff and have no idea how this code should work. Thanks for answers.