Hej igen!
Har lige opdaget at det er denne kode jeg skal bruge!. Men den giver samme fejl!. Her er "or die" med, men giver samme fejl med "Warning mysql ... osv!"
Går man ind på denne side:
http://www.namsen.dk/index.php?side=80og bare klikker på "Find" skulle der komme en liste med alle fangster, alle år, alle vald, alle elve.
koden ser sådan ud:
<?
if ($Vald == "Alle vald"){{
$connection = mysql_connect("mysql.namsen.dk","namvllno","xfl99iuo"); //indstillinger omkring Mysql database
mysql_select_db("namsendk", $connection) or die ("Problem connecting to DataBase");
$result1 = mysql_query("select AVG(vekt) AS avgvekt from namsen$Aar
where dato like '%$Md%'
and fisker like '%$seek%'
and elv like '%$elv%'
and vekt BETWEEN '$minVekt' AND '$maxVekt'");
$myrow = mysql_fetch_array($result1);
$avg=$myrow["avgvekt"];
$rounded = round($avg,2);
$result2 = mysql_query("select SUM(vekt) AS total from namsen$Aar
where dato like '%$Md%'
and fisker like '%$seek%'
and elv like '%$elv%'
and vekt BETWEEN '$minVekt' AND '$maxVekt'");
$myrow1 = mysql_fetch_array($result2);
$tot=$myrow1["total"];
$result = mysql_query("select dato, vald, fisker, vekt, redskap, elv from namsen$Aar
where dato like '%$Md%'
and fisker like '%$seek%'
and elv like '%$elv%'
and vekt BETWEEN '$minVekt' AND '$maxVekt' order by vekt desc");
$number = mysql_num_rows($result);
if ($Md == ".05."){
$change_date = "Maj";
} else if ($Md == ".06."){
$change_date = "Juni";
} else if ($Md == ".07."){
$change_date = "Juli";
} else if ($Md == ".08."){
$change_date = "August";
} else if ($Md == ".09."){
$change_date = "September";
} else if ($Md == "Vælg periode"){
$change_date = "Vælg periode";
} else if ($Md == ""){
$change_date = "Hele sæsonen";
}
?>
<table width="100%" border="0">
<tr>
<td><form action="index.php?side=503" method="post">
<div align="left">
<input type="hidden" name="Aar" value="<? print ($Aar); ?>">
<input type="submit" name="<? print ($Aar); ?>3" value="Top 30 <? print ($Aar); ?>">
</div>
</form></td>
<td><form action="index.php?side=502" method="post">
<div align="right">
<input type="hidden" name="Aar" value="<? print ($Aar); ?>">
<input type="submit" name="<? print ($Aar); ?>2" value="Vis fòrdeling på vald <? print ($Aar); ?>">
</div>
</form></td>
</tr>
</table>
<?
print "<font face=verdana size=1>Din søgning på: - <b>$seek</b> - <b>$elv</b> - <b>$change_date - <b>$Aar</b> - <b>$Vald</b></b> med vægt mellem <b>$minVekt</b> kg og <b>$maxVekt</b> kg fandt <b>$number</b> fangster sorteret efter vægt. Gennemsnitsvægt: <b>$rounded</b> kg. Totalvægt: <b>$tot</b> kg.</font><br><br>" ;
print ("<table width=100%>");
print ("<td bgcolor=ABAB81><font face=verdana color=663333 size=2><b> Dato</b></font></td>");
print ("<td bgcolor=ABAB81><font face=verdana color=663333 size=2><b> Vald</b></font></td>");
print ("<td bgcolor=ABAB81><font face=verdana color=663333 size=2><b> Fisker/Roer</b></font></td>");
print ("<td bgcolor=ABAB81><font face=verdana color=663333 size=2><b> Vekt</b></font></td>");
print ("<td bgcolor=ABAB81><font face=verdana color=663333 size=2><b> Redskap</b></font></td>");
print ("<td bgcolor=ABAB81><font face=verdana color=663333 size=2><b> Elv</b></font></td>");
while ($row = mysql_fetch_array($result)) {
print("<tr>");
print("<td><font face=verdana size=1> $row[dato]</font></td><td><font face=verdana size=1><b> $row[vald]</b></font></td><td><font face=verdana size=1> $row[fisker]</font></td><td><font face=verdana size=1><b> $row[vekt]</b></font></td><td><font face=verdana size=1> $row[redskap]</font></td><td><font face=verdana size=1> $row[elv]</font></td>");
print("</tr>");
}
}
print("</table>");
}else {{
$connection = mysql_connect("mysql.namsen.dk","namsendk","uqy24jyc"); //indstillinger omkring Mysql database
mysql_select_db("namsendk", $connection) or die ("Problem connecting to DataBase");
$result1 = mysql_query("select AVG(vekt) AS avgvekt from namsen$Aar
where vald like '$Vald'
and dato like '%$Md%'
and fisker like '%$seek%'
and elv like '%$elv%'
and vekt BETWEEN '$minVekt' AND '$maxVekt'");
$myrow = mysql_fetch_array($result1);
$avg=$myrow["avgvekt"];
$rounded = round($avg,2);
$result2 = mysql_query("select SUM(vekt) AS total from namsen$Aar
where vald like '$Vald'
and dato like '%$Md%'
and fisker like '%$seek%'
and elv like '%$elv%'
and vekt BETWEEN '$minVekt' AND '$maxVekt'");
$myrow1 = mysql_fetch_array($result2);
$tot=$myrow1["total"];
$result = mysql_query("select fisker, vald, vekt, dato, redskap, elv from namsen$Aar
where vald like '$Vald'
and dato like '%$Md%'
and fisker like '%$seek%'
and elv like '%$elv%'
and vekt BETWEEN '$minVekt' AND '$maxVekt' order by vekt desc");
$number = mysql_num_rows($result);
if ($Md == ".05."){
$change_date = "Maj";
} else if ($Md == ".06."){
$change_date = "Juni";
} else if ($Md == ".07."){
$change_date = "Juli";
} else if ($Md == ".08."){
$change_date = "August";
} else if ($Md == ".09."){
$change_date = "September";
} else if ($Md == "Vælg periode"){
$change_date = "Vælg periode";
} else if ($Md == ""){
$change_date = "Hele sæsonen";
}
?>
<table width="100%" border="0">
<tr>
<td><form action="index.php?side=503" method="post">
<div align="left">
<input type="hidden" name="Aar" value="<? print ($Aar); ?>">
<input type="submit" name="<? print ($Aar); ?>3" value="Top 30 <? print ($Aar); ?>">
</div>
</form></td>
<td><form action="index.php?side=502" method="post">
<div align="right">
<input type="hidden" name="Aar" value="<? print ($Aar); ?>">
<input type="submit" name="<? print ($Aar); ?>2" value="Vis fòrdeling på vald <? print ($Aar); ?>">
</div>
</form></td>
</tr>
</table>
<?
print "<font face=verdana size=1>Din søgning på: - <b>$seek</b> - <b>$elv</b> - <b>$change_date - <b>$Aar</b> - <b>$Vald</b></b> med vægt mellem <b>$minVekt</b> kg og <b>$maxVekt</b> kg fandt <b>$number</b> fangster sorteret efter vægt. Gennemsnitsvægt: <b>$rounded</b> kg. Totalvægt: <b>$tot</b> kg.</font><br><br>" ;
print("<table width=100%>");
print ("<td bgcolor=ABAB81><font face=verdana color=663333 size=2><b> Dato</b></font></td>");
print ("<td bgcolor=ABAB81><font face=verdana color=663333 size=2><b> Vald</b></font></td>");
print ("<td bgcolor=ABAB81><font face=verdana color=663333 size=2><b> Fisker/Roer</b></font></td>");
print ("<td bgcolor=ABAB81><font face=verdana color=663333 size=2><b> Vekt</b></font></td>");
print ("<td bgcolor=ABAB81><font face=verdana color=663333 size=2><b> Redskap</b></font></td>");
print ("<td bgcolor=ABAB81><font face=verdana color=663333 size=2><b> Elv</b></font></td>");
while ($row = mysql_fetch_array($result)) {
print("<tr>");
print("<td><font face=verdana size=1> $row[dato]</font></td><td><font face=verdana size=1><b> $row[vald]</b></font></td><td><font face=verdana size=1> $row[fisker]</font></td><td><font face=verdana size=1><b> $row[vekt]</b></font></td><td><font face=verdana size=1> $row[redskap]</font></td><td><font face=verdana size=1> $row[elv]</font></td>");
print("</tr>");
}
}
print("</table>");
}
?>
<hr align="left" color="#ABAB81" noShade size="1" width="100%">
Er på herrens mark