vince2doom
01-06-2006, 09:37 AM
Ive got a script problem with my search script..
error:
http://ring4free.ri.funpic.de/mp3/zoeken.php
(press also search button.)
code:
<center>
<?php
error_reporting(E_ALL);
include("config.php");
$opzoeken = mysql_query("select * from admin");
$controle = mysql_fetch_object($opzoeken);
if($_GET[zoek] != "") { //de grote if
$term = $_GET["s"];
$query2 = mysql_query("SELECT FROM songs WHERE MATCH (artiest,lied) AGAINST ('$term')");
$aantal = mysql_num_rows($query2);
if($aantal == "0") {
echo "<u>Er zijn geen resultaten gevonden.</u>\n";
}
else {
if($controle->opzoeken != "uit") {
$query = mysql_query("SELECT * FROM songs WHERE MATCH (artiest,lied) AGAINST ('$term')");
echo "<u>Er is/zijn <b>$aantal</b> resultaat(en) gevonden.\n";
echo "<table border=\"1\" width=\"700\" cellspacing=\"0\" cellpadding=\"0\">\n";
echo "<tr>\n";
echo "<td width=\"20%\">\nArtiestnaam\n</td>\n";
echo "<td width=\"20%%\">\nSongnaam\n</td>\n";
echo "<td width=\"20%\">\nZoek op\n</td>\n";
echo "</tr>\n";
while($row = mysql_fetch_object($query)){
echo "<tr>\n";
echo "<td width=\"20%\">\n$row->artiest\n</td>\n";
echo "<td width=\"20%\">\n$row->lied\n</td>\n";
echo "<td width=\"20%\">\n<a href=\"http://www.google.com/search?hl=nl&q=$row->artiest+$row->lied\" target=\"_blank\">Zoek info</a>\n</td>\n";
echo "</tr>\n";
}
echo "</table>\n";
}
else {
$query = mysql_query("SELECT * FROM songs WHERE MATCH (artiest,lied) AGAINST ('$term')");
echo "<table border=\"1\" width=\"700\" cellspacing=\"0\" cellpadding=\"0\">\n";
echo "<tr>\n";
echo "<td width=\"20%\">\nArtiestnaam\n</td>\n";
echo "<td width=\"20%%\">\nSongnaam\n</td>\n";
echo "</tr>\n";
while($row = mysql_fetch_object($query)){
echo "<tr>\n";
echo "<td width=\"20%\">\n$row->artiest\n</td>\n";
echo "<td width=\"20%\">\n$row->lied\n</td>\n";
echo "</tr>\n";
}
echo "</table>\n";
echo "<br>\n";
}
}
}
else {
echo "<form method=\"GET\" action=\"zoeken.php\">\n";
echo "zoek liedje op: <input type=\"text\" name=\"s\">\n <input type=\"submit\" value=\"zoek\" name=\"zoek\">\n";
echo "</form>\n";
}
?>
<a href="http://www.php.net" target="_blank"><img src="images/php.gif" border="0"></a>
</center>
error:
http://ring4free.ri.funpic.de/mp3/zoeken.php
(press also search button.)
code:
<center>
<?php
error_reporting(E_ALL);
include("config.php");
$opzoeken = mysql_query("select * from admin");
$controle = mysql_fetch_object($opzoeken);
if($_GET[zoek] != "") { //de grote if
$term = $_GET["s"];
$query2 = mysql_query("SELECT FROM songs WHERE MATCH (artiest,lied) AGAINST ('$term')");
$aantal = mysql_num_rows($query2);
if($aantal == "0") {
echo "<u>Er zijn geen resultaten gevonden.</u>\n";
}
else {
if($controle->opzoeken != "uit") {
$query = mysql_query("SELECT * FROM songs WHERE MATCH (artiest,lied) AGAINST ('$term')");
echo "<u>Er is/zijn <b>$aantal</b> resultaat(en) gevonden.\n";
echo "<table border=\"1\" width=\"700\" cellspacing=\"0\" cellpadding=\"0\">\n";
echo "<tr>\n";
echo "<td width=\"20%\">\nArtiestnaam\n</td>\n";
echo "<td width=\"20%%\">\nSongnaam\n</td>\n";
echo "<td width=\"20%\">\nZoek op\n</td>\n";
echo "</tr>\n";
while($row = mysql_fetch_object($query)){
echo "<tr>\n";
echo "<td width=\"20%\">\n$row->artiest\n</td>\n";
echo "<td width=\"20%\">\n$row->lied\n</td>\n";
echo "<td width=\"20%\">\n<a href=\"http://www.google.com/search?hl=nl&q=$row->artiest+$row->lied\" target=\"_blank\">Zoek info</a>\n</td>\n";
echo "</tr>\n";
}
echo "</table>\n";
}
else {
$query = mysql_query("SELECT * FROM songs WHERE MATCH (artiest,lied) AGAINST ('$term')");
echo "<table border=\"1\" width=\"700\" cellspacing=\"0\" cellpadding=\"0\">\n";
echo "<tr>\n";
echo "<td width=\"20%\">\nArtiestnaam\n</td>\n";
echo "<td width=\"20%%\">\nSongnaam\n</td>\n";
echo "</tr>\n";
while($row = mysql_fetch_object($query)){
echo "<tr>\n";
echo "<td width=\"20%\">\n$row->artiest\n</td>\n";
echo "<td width=\"20%\">\n$row->lied\n</td>\n";
echo "</tr>\n";
}
echo "</table>\n";
echo "<br>\n";
}
}
}
else {
echo "<form method=\"GET\" action=\"zoeken.php\">\n";
echo "zoek liedje op: <input type=\"text\" name=\"s\">\n <input type=\"submit\" value=\"zoek\" name=\"zoek\">\n";
echo "</form>\n";
}
?>
<a href="http://www.php.net" target="_blank"><img src="images/php.gif" border="0"></a>
</center>
