I am working on music website. I am not able to use the find the search code.
Structure of table is like that:
name of table: punjabiaudio
id,picture,albumane,artist,name1,code1…
My html code:
<form action=“search.php” method=“post” name=“search” align=“left_column”>
<h1>Search: <input name=“find” type=“text” “”/>
<select name=“select” name=“option”">
<option value=“artist” name=“artist”>artist</option>
<option value=“albumname” name=“albumname” >albumname</option>
<option value=“song” name=“song”>song</option>
</select>
<input type="hidden" name="searching" value="yes" />
<input type="button" name="search" value="GO" />
</form>
My php code:
<?php
include_once(“config.php”);
if($_SERVER[‘REQUEST_METHOD’]==‘POST’)
{
$name= $_POST[‘find’];
$option=$_POST[‘artist,albumname,song’];
$query1="select * from punjabiaudio where upper($name) LIKE'%$find%',artist='$option'";
while($result = mysql_fetch_array( $data ))
{
$path=“admin/pbiaudimages/”.$row[‘picture’];
echo"<a href=‘pbialbum.php?id=“.$row[‘albumname’].”’><img src=$path width=‘150px’ height=‘150px’></a> ";
}
}
?>
i know that my php code is wrong.please tell me the right code its urgent.
The results should on next page.
thnx in advance