Hello. Basically what I want to do in this script is simply display a form with a varying number of tables, based upon what is currently in the database. Then, this information will be passed into a function which will handle adding/removing the information from the mySQL database. My question is, since I don't know how many rows are there, how can I pass this through the function? I've put a series of ?s in the area where I need help coding. Thanks in advance.
<?php
session_start();
header("Cache-control: private"); // IE 6 Fix.
require("header.php");
require("functions.php");
if (authenticate($_SESSION['username'],$_SESSION['password'],1) == 1) {
if(!isset($_POST['submitted'])) {
$result = mysql_query("SELECT * FROM ranks ORDER BY num");
echo("<form action=editRanks.php?PHPSESSID=$session method=post name=changeInfo>");
while($ranks = mysql_fetch_array($result)) {
echo ("<input type=checkbox name=delete".$ranks['num']." value=1>
<input name=num".$ranks['num']." type=text value=$ranks[num]>
<input name=name".$ranks['name']." type=text value=\"$ranks[name]\">
<input name=img".$ranks['img']." type=text value=\"$ranks[img]\"><br>");
}
echo("<input type=submit name=Submit value=\"Edit Ranks\"></form>");
}
else {
editRanks(????????????????);
}
}
require("footer.php");
?>