I would like to sort the content of my database using selection box. But it is not working.
I have a form with:
<Form action="prodtab.php" method="post">
Sort Status: <br>
<select name="SelectType">
<option value="WHERE Status=inactive">Status-Inactive</option>
<option value="WHERE Status=active">Status-Active</option>
</select>
<input type="submit" value="Go">
</Form>
This is the query line in the php file:
$result = mysql_query("SELECT * FROM prodtab ".$_POST['SelectType']." " ,$connection);
If I hardcode in as below then it is works:
//$result = mysql_query("SELECT * FROM prodtab WHERE Status=\"inactive\" ",$connection);
How can I pass the value string with the \ in the POST from?
I have a form with:
<Form action="prodtab.php" method="post">
Sort Status: <br>
<select name="SelectType">
<option value="WHERE Status=inactive">Status-Inactive</option>
<option value="WHERE Status=active">Status-Active</option>
</select>
<input type="submit" value="Go">
</Form>
This is the query line in the php file:
$result = mysql_query("SELECT * FROM prodtab ".$_POST['SelectType']." " ,$connection);
If I hardcode in as below then it is works:
//$result = mysql_query("SELECT * FROM prodtab WHERE Status=\"inactive\" ",$connection);
How can I pass the value string with the \ in the POST from?