need help to update a mysql table from dynamic form
| From: | Patrick Aljord | Date: | Sat, 04 Feb 2006 23:07:22 +0000 |
| Subject: | need help to update a mysql table from dynamic form | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-229882@lists.php.net to get a copy of this message | ||
could someone please help me on that one? http://hashphp.org/pastebin?pid=6156
basically this is how I do:
I display a mysql table in an html table and I put each value in an
input text box.
At the bottom I put a submit button to update changes.
My question is how do I update everything knowing that I don't know in
advance the name of all the input textbox?
Here is the code to display the table:
<table width=\"1\" border=\"1\">
<tbody>
<tr>
<td><strong>English</strong></td>
<td><strong>Français</strong></td>
<td><strong>Español</strong></td>
";
$getdisplaycatname = "select
catid,categoryfr,categoryen,categoryes,categoryar from category";
$getdisplaycatnameq = mysql_query($getdisplaycatname);
while ($getcatrow = mysql_fetch_array($getdisplaycatnameq)){
//$display_category=mysql_result($getcatnameq, 0);
$showcatid=$getcatrow['catid'];
$showcat=$getcatrow['categoryfr'];
$showcaten=$getcatrow['categoryen'];
$showcates=$getcatrow['categoryes'];
echo " <tr>
<td> <input type=\"text\" name=\"<????>\"
value=\"$showcaten\"
size=\"18\"/></td>
<td> <input type=\"text\" name=\"<????>\"
value=\"$showcat\"
size=\"18\"/></td>
<td> <input type=\"text\" name=\"<????>\"
value=\"$showcates\"
size=\"18\"/></td>
</tr>
";
}
echo "
</tr>
</tbody>
</table>
<br /><input type=\"submit\" name=\"update\"
value=\"update\" /></form>
";
thanx in advance
Pat