rendered paste body mysql_select_db("ypeceb2m_files", $con);
$searchtext = $_POST['search'];
$temp = explode(", ", $searchtext);
for ($i=0; $i<count($temp); $i++)
{
$result = mysql_query("select * from files,tags where tags.id = files.id and tags.tag LIKE '%".$temp[$i]."%'") or die(mysql_error());;
if (mysql_num_rows($result) > 0)
{
$row = mysql_fetch_assoc($result);
while ( $row )
{
$currow = $row['id'];
echo "Name: ".$row['name']."<br />";
echo "Description: ".$row['description']."<br />";
echo "Location: <a href='{$row['location']}'>{$row['location']}</a> <br /> ";
echo "Uploaded by: ".$row['author']."<br />";
echo "Tags: ";
while ($row['id'] == $currow)
{
$tags = explode(', ', $row['tag']);
foreach($tags as $a=>$b)
{
echo "<a href = 'tag.php?tag=$b'>$b</a> ";
}
$lastrow = $row;
$row = mysql_fetch_assoc($result);
}
echo "<br />";
}