Probleme beim Lastnews und Comments!

vodka

Mitglied
Hallo,
ich habe ein problem und zwar wen ich Lastnews bei meiner Page als erstes kommt geht die Comments nicht mehr weil beim code die Lastnews am anfang kommt und Comments nachher und dan immer beim Comment die 1 News die ich geschrieben habe kommt!

Hier schaut mal geht auf Comments des Neusten News das ich geschrieben habe:

team-invision

Habt ihr gsehen beim News steht test2 aber wen man auf Comments klickt steht nur test das ist vom vorigen News das ich geschrieben habe!
Ich geb euch mal die code
Hier mal code wen das Lastnews drin ist aber Comments ned richtig geht:

PHP:
<html>
<head>
<title>team.InViSion</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<style type="text/css">
.small{
	font-family: verdana;
	font-size: xx-small;
	color: #404040;
}

.content {
	font-family: Verdana;
	font-size: 12;
	font-weight: bold;
	color: #999999;
}

body,table,td
{ 
	font-family: verdana; 
	font-size: 8pt; 
	color: #121212 
}

a:link       { text-decoration: none;color: #404040}
a:visited    { text-decoration: none;color: #404040}
a:active     { text-decoration: none;color: #404040}
a:hover      { text-decoration: none;color: #999999}

</style>

</head>
<body bgcolor=#FFFFFF topmargin=0 leftmargin=0>

<table width=800 border=0 cellpadding=0 cellspacing=0 align=center background="../images/invision_23.gif">
	<tr>
		<td width=23 nowrap></td>
		<td width=25 nowrap></td>
		<td width=27 nowrap></td>
		<td width=94 nowrap></td>
		<td width=10 nowrap></td>
		<td width=222 nowrap></td>
		<td width=10 nowrap></td>
		<td width=80 nowrap></td>
		<td width=8 nowrap></td>
		<td width=134 nowrap></td>
		<td width=11 nowrap></td>
		<td width=142 nowrap></td>
		<td width=14 nowrap></td>
		<td></td>
	</tr>
	<tr>
		
    <td colspan=13> <img src="http://www.dalton-clan.com/team-invision/images/invision_01.gif" width=800 height=100 border=0 usemap="#navigation"></td>
		<td height=100 nowrap></td>
	</tr>
	<tr valign=top>
		<td colspan=3 rowspan=3>
			<img src="http://www.dalton-clan.com/team-invision/images/invision_02.gif" width=75 height=115></td>
		<td rowspan=2 width=94 height=91 bgcolor="#F5F5F5"><img src="http://www.dalton-clan.com/team-invision/images/logo.gif"></td>
		<td rowspan=3>
			<img src="http://www.dalton-clan.com/team-invision/images/invision_04.gif" width=10 height=115></td>
		
    <td rowspan=2 background="http://www.dalton-clan.com/team-invision/images/invision_05.gif" width=222 height=91 class="small"> 

     <?php
// Zur config datei Includen //
include("dbnews.php");


// Verbindung mit der Datenbank erstellen //
$db = mysql_connect($db_host, $db_user, $db_pass);
mysql_select_db ($db_name) or die ("Cannot connect to database");


// Tabelle //
$query = "SELECT * FROM $tabelle ORDER BY id DESC LIMIT 5";
$result = mysql_query($query);
while($r=mysql_fetch_array($result))
{
$name=$r["name"];
$titel=$r["titel"];
$news=$r["news"];
$email=$r["email"];
$link=$r["link"];
$datum=$r["datum"];
$id=$r["id"];

echo "
<table width='126' border='0' cellspacing='0' cellpadding='0'>
  <tr>
    <td> <img src='http://www.dalton-clan.com/team-invision/images/arrow.gif' width='9' height='7'>
<a href='$comments
comments.php?id=$id'>$titel
      </a></td>
  </tr>
</table>";
}
?>---------<br> <a href="http://www.dalton-clan.com/team-invision/index.php?action=archiv">&raquo;
      archiv </a> </td>
		<td rowspan=3>
			<img src="http://www.dalton-clan.com/team-invision/images/invision_06.gif" width=10 height=115></td>
		<td colspan=3 rowspan=2 background="http://www.dalton-clan.com/team-invision/images/invision_07.gif" width=222 height=91 class="small">
			{lastwars}
		</td>
		<td rowspan=6>
			<img src="http://www.dalton-clan.com/team-invision/images/invision_08.gif" width=11 height=147></td>
		<td background="http://www.dalton-clan.com/team-invision/images/invision_09.gif" width=142 height=90 class="small">
			{stats}
		</td>
		<td rowspan=6>
			<img src="http://www.dalton-clan.com/team-invision/images/invision_10.gif" width=14 height=147></td>
		<td height=90 nowrap></td>
	</tr>
	<tr>
		<td rowspan=5>
			<img src="http://www.dalton-clan.com/team-invision/images/invision_11.gif" width=142 height=57></td>
		<td height=1 nowrap></td>
	</tr>
	<tr>
		<td>
			<img src="http://www.dalton-clan.com/team-invision/images/invision_12.gif" width=94 height=24></td>
		<td>
			<img src="http://www.dalton-clan.com/team-invision/images/invision_13.gif" width=222 height=24></td>
		<td colspan=3>
			<img src="http://www.dalton-clan.com/team-invision/images/invision_14.gif" width=222 height=24></td>
		<td height=24 nowrap></td>
	</tr>
	<tr>
		<td colspan=2 rowspan=2>
			<img src="http://www.dalton-clan.com/team-invision/images/invision_15.gif" width=48 height=31></td>
		
    <td colspan=6 background="http://www.dalton-clan.com/team-invision/images/invision_16.gif" width=443 height=24 class="content"> 
      { Content :: } </td>
		<td colspan=2 rowspan=2>
			<img src="http://www.dalton-clan.com/team-invision/images/invision_17.gif" width=142 height=31></td>
		<td height=24 nowrap></td>
	</tr>
	<tr>
		<td colspan=6>
			<img src="http://www.dalton-clan.com/team-invision/images/invision_18.gif" width=443 height=7></td>
		<td height=7 nowrap></td>
	</tr>
	<tr valign=top>
		<td rowspan=2 width=23 height=290></td>
		
    <td colspan=8 rowspan=2 background="http://www.dalton-clan.com/team-invision/images/invision_20.gif" width=476 height=290><div align="center"> 
        <form name="form1" method="post" action="<? $php_self ?>">
          <div align="center"> 
            <p><br>
              <?php
// Zur config datei Includen //
include "dbnews.php";

// Verbindung mit der Datenbank erstellen //
$db = mysql_connect($db_host, $db_user, $db_pass);
mysql_select_db ($db_name) or die ("Cannot connect to database");


// hier das Limit ändern
$query = "SELECT *, DATE_FORMAT(datum,'%d.%m.%Y') AS datum_de FROM $tabelle where id = $id";
$result = mysql_query($query);
while($r=mysql_fetch_array($result))
{
$name=$r["name"];
$titel=$r["titel"];
$news=$r["news"];
$email=$r["email"];
$link=$r["link"];
$datum=$r["datum_de"];
$id=$r["id"];
$bild=$r["bild"];


$s1 = "SELECT  * FROM $tabellec  WHERE newsid = '$id'" ;
$q1 = mysql_query($s1) ;
$c = mysql_num_rows($q1) ;



echo "
<table style='BORDER-COLLAPSE: collapse'
table width='366' border='1' align='center' cellpadding='0' cellspacing='0' bordercolor='#000000'>
  <tr bgcolor='#777777'>
    <td width='283'>
      <div align='left'><font color='#cccccc'><strong>$titel
        </strong></font></div></td>
    <td width='100'>
      <div align='center'><font color='#FFFFFF'><strong><a href='mailto:$email'>$name</a></strong></font></div></td>
  </tr>
  <tr>
    <td colspan='2'><table width='362' border='0' cellspacing='10'>
        <tr>
          <td width='72'><img src='$bild' width='60' height='58'></td>
          <td width='256'>$news</td>
        </tr>
      </table>
      <table width='363' border='0'>
        <tr>
          <td width='241'><p align='left'><strong>Links: </strong><a href='$link'>$link</a></p>

</td>
<td width='112'><div align='center'><a href='$comments
comments.php?id=$id'>comments($c)</a></div></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table width='367' border='0' align='center'>
  <tr>
    <td width='288' height='21'>
<div align='right'></div></td>
    <td width='78'><div align='center'><strong>$datum</strong></div></td>
  </tr>
</table>
<table width='346' border='0' align='center'>
  <tr>
    <td width='302' height='21'> <div align='right'></div></td>
    <td width='34'><div align='center'><strong></strong></div></td>
  </tr>
</table>";
}


?>
            <p> 
            <p> 
            <p>


              <?php
// Zur config datei Includen //
include "dbnews.php";

// Verbindung mit der Datenbank erstellen //
$db = mysql_connect($db_host, $db_user, $db_pass);
mysql_select_db ($db_name) or die ("Cannot connect to database");

// Tabelle //
$query = "SELECT *, DATE_FORMAT(datum,'%d.%m.%Y') AS datum_de FROM $tabellec where newsid = $id";
$result = mysql_query($query);
while($r=mysql_fetch_array($result))
 {
$name=$r["name"];
$email=$r["email"];
$text=$r["text"];
$id=$r["newsid"];
$titel=$r["titel"];
$datum=$r["datum_de"];


echo "<table style='BORDER-COLLAPSE: collapse'
table width='310' border='1' align='center' cellpadding='0' cellspacing='0' bordercolor='#000000'>
  <tr>
    <td width='164' bgcolor='#666666'><div align='justify'><font color='#FFFFFF' size='2'><strong>$titel</strong></font></div></td>
    <td width='140' bgcolor='#666666'><div align='center'><strong><font color=#FFFFFF' size='2'><em><font color='#FFFFFF'>$datum
        by:</font></em> <a href=mailto:$email>$name</a></font></strong></div></td>
  </tr>
  <tr>
    <td height='20' colspan='2'><table width='305' border='0' cellspacing='10'>
        <tr>
          <td width='283'>$text</td>
        </tr>
      </table></td>
  </tr>
</table>
<table width='50' border='0' align='center'>
  <tr>
    <td width='44'>&nbsp;</td>
  </tr>
</table>";
}
?>
              <?php

if (isset ($send) )
{


include "dbnews.php";
$db = mysql_connect($db_host, $db_user, $db_pass);
mysql_select_db ($db_name) or die ("Cannot connect to database");


$query = "INSERT INTO  $tabellec(name,
email,
text,
newsid,
titel,
datum)
VALUES('$_POST[name]','$_POST[email]','$_POST[text]','$id','$_POST[titel]', now())";
$result = mysql_query($query);
echo "Comment erfolgreich eingetragen";
echo "<meta http-equiv='refresh' content='1; URL=$php_self'>";
}
else
{
?>
            </p>
          </div>
          <table width="276" border="0" align="center">
            <tr> 
              <td> <div align="left">Name:</div></td>
              <td> <div align="left"> 
                  <input type="text" name="name">
                </div></td>
            </tr>
            <tr> 
              <td> <div align="left">Titel:</div></td>
              <td> <div align="left"> 
                  <input name="titel" type="text" id="titel3">
                </div></td>
            </tr>
            <tr> 
              <td> <div align="left">Email:</div></td>
              <td> <div align="left"> 
                  <input type="text" name="email">
                </div></td>
            </tr>
            <tr> 
              <td> <div align="left">Comment:</div></td>
              <td> <div align="left"> 
                  <textarea name="text" cols="19" rows="3"></textarea>
                </div></td>
            </tr>
            <tr> 
              <td> <div align="left"></div></td>
              <td> <div align="left"> 
                  <input type="submit" name="Abschicken" value="Abschicken">
                </div></td>
            </tr>
          </table>
          <input type="hidden" name="send" value="true">
          <?
}
?>
        </form>
        <p>&nbsp;</p>
      </div></td>
		<td>
			<img src="http://www.dalton-clan.com/team-invision/images/invision_21.gif" width=134 height=1></td>
		<td height=1 nowrap></td>
	</tr>
	<tr valign=top>
		<td colspan=4 width=301 height=289>
			<table width=301 border=0 cellpadding=0 cellspacing=0>
				<tr>
					<td colspan=2>
						<img src="http://www.dalton-clan.com/team-invision/images/invision_22_01.gif" width=301 height=27></td>
				</tr>
				<tr valign=top>
					<td rowspan=2>
						<img src="http://www.dalton-clan.com/team-invision/images/invision_22_02.gif" width=55 height=262></td>
					
          <td background="http://www.dalton-clan.com/team-invision/images/invision_22_03.gif" width=246 height=182> {kommt 
            noch...} </td>
				</tr>
				<tr>
					<td>
						<img src="http://www.dalton-clan.com/team-invision/images/invision_22_04.gif" width=246 height=80></td>
				</tr>
			</table>
		</td>
		<td height=289 nowrap></td>
	</tr>

	<tr>
		<td colspan=13>
			<img src="http://www.dalton-clan.com/team-invision/images/invision_24.gif" width=800 height=40></td>
		<td height=40 nowrap></td>
	</tr>
</table>
<map name="navigation">
  <area shape="rect" coords="228,55,279,67" href="http://www.dalton-clan.com/team-invision/index.php?action=news" alt=":: news">
	
  <area shape="rect" coords="277,55,342,67" href="http://www.dalton-clan.com/team-invision/index.php?action=members" alt=":: members">
	
  <area shape="rect" coords="344,55,409,67" href="http://www.dalton-clan.com/team-invision/index.php?action=wars" alt=":: clanwars">
	
  <area shape="rect" coords="416,55,481,67" href="http://www.dalton-clan.com/team-invision/index.php?action=files" alt=":: downloads">
	
  <area shape="rect" coords="488,55,526,67" href="http://www.dalton-clan.com/team-invision/index.php?action=poll" alt=":: poll">
	
  <area shape="rect" coords="530,55,602,67" href="http://www.dalton-clan.com/team-invision/index.php?action=gb" alt=":: guestbook">
	<area shape="rect" coords="602,55,656,67" href="" alt=":: forum">
	
  <area shape="rect" coords="656,55,726,67" href="http://www.dalton-clan.com/team-invision/index.php?action=sponsoren" alt=":: sponsoren">
</map>
</body>
</html>



Jetzt will ich das Lastnews und Comments geht wie mach ich das?
 
Da du dich nicht an die Regeln hälst, wird sich garantiert auch niemand durch deinen Code wühlen. Sorry, aber keiner hier hat die Zeit und Lust sich 300 Zeilen Unsinn durchzulesen und dann mal die Problemstellung zu finden.
Poste den wichtigen Teil, der Rest kann verrotten. Und wenn was fehlt, wird sich schon wer melden.

Grüße, Ronin
 

Neue Beiträge

Zurück