Hi,
I'm using the following code to show the category = thoughts. I have three categories, when i select thoughts only it has to show the thoughts category. If i select other category it has to show that particular category details. I don't know how i have to mention the particular category. Please help me.
[code=php]
<?php
if(isset($_POST['submit']) && ($_POST['submit']=="GO"))
{
$sqlquery2="sel ect * from news where category like '%thoughts%'";
$queryresult2 = mysql_query($sq lquery2) or die(mysql_error ());
while ($arr2=mysql_fe tch_array($quer yresult2))
{
echo $arr2["day"]."<br>";
echo $arr2["category"]."<br>";
echo $arr2["title"]."<br>";
echo $arr2["article"]."<br>";
}
}
?>
<form action="test2.p hp" method="post">
<hr>
<h4>"Category "</h4>
Select your Category:
<select name="category" >
<option value="thoughts ">thoughts</option>
<option value="travel"> Travel</option>
<option value="importan t_events" selected="selec ted">Important_ Events</option>
</select>
<input type="submit" name="submit" value="GO" />
</form>
</body>
</html>
[/code]
I'm using the following code to show the category = thoughts. I have three categories, when i select thoughts only it has to show the thoughts category. If i select other category it has to show that particular category details. I don't know how i have to mention the particular category. Please help me.
[code=php]
<?php
if(isset($_POST['submit']) && ($_POST['submit']=="GO"))
{
$sqlquery2="sel ect * from news where category like '%thoughts%'";
$queryresult2 = mysql_query($sq lquery2) or die(mysql_error ());
while ($arr2=mysql_fe tch_array($quer yresult2))
{
echo $arr2["day"]."<br>";
echo $arr2["category"]."<br>";
echo $arr2["title"]."<br>";
echo $arr2["article"]."<br>";
}
}
?>
<form action="test2.p hp" method="post">
<hr>
<h4>"Category "</h4>
Select your Category:
<select name="category" >
<option value="thoughts ">thoughts</option>
<option value="travel"> Travel</option>
<option value="importan t_events" selected="selec ted">Important_ Events</option>
</select>
<input type="submit" name="submit" value="GO" />
</form>
</body>
</html>
[/code]
Comment