Unable to pass variable...
Posted: Wed May 29, 2002 10:17 pm
Hi guys -
i have a drop down of which the module titles are populated from a table within mysql.
Problem that i am having is that when i choose the module title, and click on submit, the following table does not display anything, im assuming that the variable isnt being captured and sent..
Can anybody help with ideas or correction to my coding please?
firstly, here is the dropdown script (simpler sugegstions welcome
)
here is the table which should display the results...
I really appreciate your help in helping me solve this.
-Abi
i have a drop down of which the module titles are populated from a table within mysql.
Problem that i am having is that when i choose the module title, and click on submit, the following table does not display anything, im assuming that the variable isnt being captured and sent..
Can anybody help with ideas or correction to my coding please?
firstly, here is the dropdown script (simpler sugegstions welcome
Code: Select all
<form action="search_by_module.php" method="POST">
<select name="county">
<option value="">Choose module</option>
<?php include("dbconnect.php"); ?>
<?
?>
<?
$query = mysql_query("select module_title from coursework_table");
while($rows=mysql_fetch_array($query)) {
print $rowsї"module_title"];
?>
<p><option value="<? echo $rowsї"module_title"]?>"> <?echo $rowsї"module_title"]?> </option>
<?
}
?>
</select><option></select><p><input type=submit name=Submit value="Submit"> <input type=reset name=reset value="Clear">
</p>Code: Select all
<?php include("dbconnect.php"); ?>
<?
$result = mysql_query("select * from coursework_table where module_title='$module_title' ORDER by module_title");
if ($result){
//echo ":<br><p></p>";
echo "<table width=90% align=left border=0><tr bgcolor=#CCCCCC>
<td align=left><b><font face='Verdana' size='1' color='#000080'>Coursework ID</font></b></td>
<td align=left><b><font face='Verdana' size='1'>User ID</font></b></td>
<td align=left><b><font face='Verdana' size='1' color='#000080'>Submission Time</font></b></td>
<td align=left><b><font face='Verdana' size='1'>Module Title</font></b></td>
<td align=left><b><font face='Verdana' size='1'>Description</font></b></td>
<td align=left><b><font face='Verdana' size='1' color='#000080'>View</font></b></td>
</tr>";
while ($row = mysql_fetch_array($result)) {
echo"
<tr>
<td><font size='1' face='Verdana'>$rowїcoursework_id]</font></td>
<td><font size='1' face='Verdana'>$rowїuser_id]</font></td>
<td><font size='1' face='Verdana'>$rowїsubmission_time]</font></td>
<td><font size='1' face='Verdana'>$rowїmodule_title]</font></td>
<td><font size='1' face='Verdana'>$rowїdescription]</font></td>
<td><font size='1' face='Verdana'><a href="../files/work/$rowїfilename]">View</a></font></td>
</tr>";
} echo "</table>";
} else {
echo "No data.";
}
mysql_free_result($result);
?>-Abi