im trying to search some song lyrics from my database and display in the webpage. But somehow it fails..
- Code: Select all
<form metod="POST" action="test.php">
<label> Select Language:
<select name="Language">
<option value="English">English</option>
<option value="Sinhala">Sinhala</option>
</select>
</label>
<label>Search Song: <input type="text" name="criteria" /> </label>
<input type="submit" value="Search" />
</form>
<br />
<?php
if(isset($_POST['submitted'])){
$Language = $_POST['Language'];
$criteria = $_POST['criteria'];
$query = "SELECT * FROM songs WHERE category ='$criteria'";
$result = mysql_query($query) or die();
echo "<table>";
echo "<tr> <th>Title</th> <th>Lyrics</th> </tr>";
while($row = mysql_fetch_array($result)){
echo "<tr><td>";
echo $row['Title'];
echo "</td><td>";
echo $row['Lyrics'];
echo "</td></tr>";
}
echo "</table>";
}
?>
PLEASE tell me what I did wrong.. for some reason it never goes into the if statement..



