Hi,
99% of the time when coding in php I have managed to avoid using arrays. many books and many hours of invested time I have never got comfortable with them, both in how or why they work. They are my one pretty major php bugbear.
Now I think I have no choice, i'm trying to make a form which allows the user to change the numbered order of a variable number of modules. here is the form -
<?
echo "<form name=form1 method=post action=\"moduleorder.php\"><table><tr><td>Module name</td><td>Module order</td></tr>";
$db = mysql_connect("localhost", "username", "password");
mysql_select_db("databasename",$db);
$result = mysql_query("select * from main_modules",$db);
while($row = mysql_fetch_array($result)){
echo "<tr><td>".$row["module_name"]."</td><td><input name=\"order\" type=\"text\" value=\"".$row["module_order"]."\"></td></tr>";
}
echo "<tr><td><input name=\"submit\" type=\"submit\"></td><td></td></tr></table></form>";
?>
now I've read a number of solutions given on this board for solving the changing multiple records at once problm, unfortunately my issues with arrays have so for defeated me in terms of understanding the solutions. Would anyone please be kind enough to guid me as to what I need to do in the code to process this page with extra explanation when it comes to anything involving arrays??
thanks in advance
Lcousins
EDIT: to leave it a little less open ended I am assuming I need to create an array which stores the 'module_id' and the order number as imputted by the user in the box together, and then when processing it I need to extract each pair of data out of the array, updating the sql database each time?? I know how to do none of that, but hopefully that is the right concept...