On my form, I have a drop-down that's populated based on a query result and a submit button for whichever option from the drop-down is selected:
echo "<form method='post' action='myform.php'>";
echo "<h3>Select One:";
echo "<input type='hidden' name='action' value='searching' />";
echo "<select name='choice[]'>";
echo "<option value=''> Your Choices </option>";
while ($row1 = mssql_fetch_row($result1)) {
if($i == 0)
echo "<option value='choice'> $row1[0] </option>";
$i++;
$i=0;
}
echo "</select> <input type='submit' name='display' value='Display' /><br><br>";
echo "</h3></form>";
I have about 35 queries that make up a table on the initial page. The drop-down choices will populate the table with another 35 queries that need to have variables (I assume) to calculate different numbers for the table, based on the selection made.
////////////////////////////////////////////////////////////////////////////////////////////////////////
This is kind of confusing. Let me try to give examples:
---My initial page will display the results of 35 queries ---
"select count(figure) from table where initial=1"
"select count(figure) from table where initial=2"
"select count(figure) from table where initial=3"
....and so on....
--Any selection from the drop-down (which is an array of 1 query) will display the result of--
"select count(figure) from table where initial=1 and factor=0"
"select count(figure) from table where initial=2 and factor=0"
"select count(figure) from table where initial=3 and factor=0"
....All of those queries will need to have something appended to them to signify what 'count' it's displying based on the choice that was made in the drop-down....
I'm guessing the queries may need to have something added to them that says something to the affect of: "and chosen=$choice"
And, then, how do I tell the form to display the chosen data when the submit button is clicked?
///////////////////////////////////////////////////////////////////////////////////////////////////////
Oh yeah, each row of the table looks like this:
$row101 = mssql_fetch_array($result101);
echo "<tr><td>row name1</td><td>row definition1</td><td>" . number_format($row101[0]) . "</td></tr>";
$row102 = mssql_fetch_array($result102);
echo "<tr><td>row name2</td><td>row definition2</td><td>" . number_format($row102[0]) . "</td></tr>";
$row103 = mssql_fetch_array($result103);
echo "<tr><td>row name3</td><td>row definition3</td><td>" . number_format($row103[0]) . "</td></tr>";
....and so on.....
Any help would be greatly appreciated!!!!! :-))