All pastes #626805 Raw Edit

Something

public text v1 · immutable
·published 2007-07-19 21:53 UTC
rendered paste body
					<?php
					$con = mysql_connect("localhost","ypeceb2m_files","files");
					if (!$con)
					{
					die('Could not connect: ' . mysql_error());
					}
					mysql_select_db("ypeceb2m_files", $con);
					$text = $_GET['tag'];
					for ($i=0; $i<count($text); $i++) {
							$result = mysql_query("SELECT * FROM files WHERE tags LIKE '%".$text[$i]."%'") or die(mysql_error());;
							while ($row = mysql_fetch_array($result)) {
							    echo "Name: {$row['name']} <br>";
								echo "Description: {$row['description']} <br>";
								echo "Location: <a href='{$row['location']}'>{$row['location']}</a> <br> ";
								echo "Tags: ";
								$tags = explode(', ', $row['tags']);
								foreach($tags as $a=>$b)
									{
									echo "<a href = 'tag.php?tag=$b'>$b</a> ";
									}
								echo "<br /> <br />";
								}
								}
?>