na stronie : http://www.beduinia.pvd.pl/dw2 są po prawej stronie tabele ..:: Next War ::.. i ..:: Last War ::.. w których jak wejde [More...] [Add comment...] to mi nie wyswietla danych w tych tabelach
kod do tabeli ..:: Last War ::.. (tabele next jest prawie identyczna)
[php:1:857567b87f]<?php
<center><table align="center"><?
require('db.php');
$sqlm="SELECT * FROM clanwars where type='last' ";
$sqlee="SELECT * FROM enemy where enemy_id='$id' ";
$resultm =mysql_query($sqlm);
$resultee =mysql_query($sqle);
while ($rowee=mysql_fetch_array($resultee)) {
while ($rowm=mysql_fetch_array($resultm)) {
$ide =$rowm["war_id"] ;
$s1 =$rowm["score"] ;
$s2 =$rowm["score1"] ;
if($s1>s2) {
$color=green;
$score=WIN;
} else {
$color=red;
$score=LOSS;
}
print " <tr><td ><font size="6"><a href="clanwars.php?war=$ide"> vs </font><font size="4"> ".$rowee["tag"]." </a> </font></td></tr>";
print " <tr><td ><span style="font-size: 11px; font-family: tahoma; font-weight: " align="center"> ".$rowm["time"]." </span></td></tr>";
print " <tr><td ><span style="font-size: 11px; font-family: tahoma; font-weight: " align="center"><font color="$color" > $score </font></span></td></tr>";
}
}
?></table></center>
?>[/php:1:857567b87f]
i funkcja more odpowiedzilanw skrypcie newsow za wyswietlanie po kliknieciu w "more"
[php:1:857567b87f]<?php
function more($more) {
include ("header.tpl") ;
connect();
$sql = "select * from news2 where news_id = '$more'";
$result = mysql_query($sql);
$row = mysql_fetch_array($result);
?>
<table width="600">
<tr><td style="font-size: 11px; font-family: tahoma; " ><?echo "<b>".$row["title"]."</b>" ?> </td></tr>
<?
$cat_num = $row["category_id"];
$cat_result = mysql_query("select categories.category from news2, categories where news2.category_id = categories.category_id and news2.category_id = '$cat_num'");
$cat = mysql_fetch_array($cat_result);
?><?
if($last_date == $row["date"]):?>
<tr><td style="font-size: 11px; font-family: tahoma; "><b><?echo $row["time"]?></b></td></tr>
<?else:?>
<tr><td style="font-size: 11px; font-family: tahoma; "><?echo $row["time"]?> - <b><?echo $row["date"]?></b><? endif;?></td></tr>
<tr><td style="font-size: 11px; font-family: tahoma; ">Category: <i><?echo $cat["category"] ?></i></td></tr>
<tr><td style="font-size: 11px; font-family: tahoma; "><?echo $row["intro"] ?><br></td></tr><tr><td style="font-size: 11px; font-family: tahoma; "></td></tr>
<tr><td style="font-size: 11px; font-family: tahoma; "><?echo $row["more"] ?><br></td></tr><tr><td style="font-size: 11px; font-family: tahoma; "></td></tr>
</tr></td>
</table>
<?
}
?>[/php:1:857567b87f]