Hi All,
The weathers dull, its raining again, England lost, WHAT NEW. Good luck Portugal.
My Problem.
I have a form with a selection dropdown menu on it. when I select an option and click on the submit button (Button Lable “Category”) the from action calls a PHP script. The script return NO DATA. If I run the PHP script standalone it returns data. So I think it is my form that is the problem.
THE FORM:
<form action=”category_search.php” method=”post” name=”category” target=”_self” class=”bodytext” id=”category”>
<table width=”100%” border=”0″ cellspacing=”0″ cellpadding=”0″>
<tr>
<td width=”57%” class=”bodytext”><div align=”right” class=”producttitle”>Select
</div></td>
<td width=”16%”><div align=”right”>
<select name=”category” class=”bodytext” id=”category”>
<option value=”LIM”>Library and Information Management</option>
<option value=”KM”>Knowledge Management </option>
<option value=”IP”>Intellectual Property</option>
<option value=”CON”>Construction</option>
</select>
</div></td>
<td width=”27%”><div align=”right”>
<input name=”category” type=”submit” class=”formcolheadersmall” id=”category” value=”Category”>
</div></td>
</tr>
</table>
</form>
END FORM
For reference the PHP/SQL script (part) is below.
[code=php]<?php
$colname_category_search = “1”;
if (isset($_POST[‘category’])) {
$colname_category_search = (get_magic_quotes_gpc()) ? $_POST[‘category’] : addslashes($_POST[‘category’]);
}
mysql_select_db($database_Chandos, $Chandos);
$query_category_search = sprintf(“SELECT * FROM chandos_books WHERE category = ‘%s'”, $colname_category_search);
$category_search = mysql_query($query_category_search, $Chandos) or die(mysql_error());
$row_category_search = mysql_fetch_assoc($category_search);
$totalRows_category_search = mysql_num_rows($category_search);
?>
Can anyone see what the problem is. I have been messing about with this all day.
Kind regards. keep safe and well.
Dereck