okies i keep gettin error message when am searching something.. here the link.. www.litelyrics.com/search.php and here the code..
+REP for all helpersPHP Code:<?php
require("db.php");
if(isset($_POST['search'])){
$term = $_POST['term'];
$type = $_POST['type'];
if(!isset($term)){ echo("Invalid search term specified!"); exit; }
if($type == "artist"){
$query = mysql_query("SELECT * FROM `lyrics` WHERE `artist` = '$term' ;");
}elseif($type == "song"){
$query = mysql_query("SELECT * FROM `lyrics` WHERE `song` = '$term' ;");
}
$rows = mysql_fetch_array($query);
if(!$rows[id]){ echo("Your search for <b>$term</b> returned no results in the LiteLyrics database."); exit; }
echo("You where searching for <b>$term</b> in <b>$type</b>'s:<br />");
while($rows = mysql_fetch_array($query)){
echo("<a href=\"view.php?id=$rows[id]\">$rows[song] - $rows[artist]</a><br />");
}
}else{
echo("
Please note that the LiteLyrics Search currently only supports exact matches.
<br />
<form method=\"POST\">
Search: <input type=\"text\" name=\"term\" size=\"30\"> in <select name=\"type\"> <option value=\"artist\">Artists</option>
<option value=\"song\">Tracks</option>
</select> <input type=\"submit\" name=\"search\" value=\"Search\">
</form>");
}
?>





Reply With Quote





Breaks it up from everything else in a script by having them upper case imo.
