Ik ben namelijk bezig met een gamesite, en ben nu de pagina waarop iets wordt gelezen als een nieuwsbericht of een preview. Daarbij moet ie ook de game, bedrijf, etc info laten zien waar het om gaat, die weer uit een andere tabel komt. Alleen, die hele info verschijnt niet.
PHP Versie: 4.3.8
MySQL versie: 3.23.58
PHP Info: http://www.gamerz-heaven.com/php.php
http://www.gamerz-heaven.com/readcontent2.php?id=3 (id's 1 en 2 hebben geen ingevoegde waarde van game info, maar daar laat ie nog wel info zien, op zen minst)
Daarbij wil ik ook nog even toevoegen dat dit slechts een testfase is, net zoals je bijvoorbeeld een Xbox 360 game met PS1 graphics zou zien.
De Code ziet er ook niet echt netjes uit, en over beveiliging praat ik nog niet eens.
Code: Selecteer alles
<center>
<?
if ($objtype == "game") {
$getgames = "SELECT * FROM games WHERE id=".$content->objid."";
$sqlgames = mysql_query($getgames) or die (mysql_error());
while ($games = mysql_fetch_object($sqlgames)) {
$dev_id = $games->dev_id;
$pub_id = $games->pub_id;
$pub_nl_id = $games->pub_nl_id;
$getdeveloper = "SELECT * FROM companies WHERE id=$dev_id";
$sqldeveloper = mysql_query($getcontent) or die (mysql_error());
while ($developer = mysql_fetch_object($sqldeveloper)) {
$getpublisher = "SELECT * FROM companies WHERE id=$pub_id";
$sqlpublisher = mysql_query($getpublisher) or die (mysql_error());
while ($publisher = mysql_fetch_object($sqlpublisher)) {
$getpublisher_nl = "SELECT * FROM companies WHERE id=$pub_nl_id";
$sqlpublisher_nl = mysql_query($getpublisher_nl) or die (mysql_error());
while ($publisher_nl = mysql_fetch_object($sqlpublisher_nl)) {
?>
<table width="90%" class="rc_gameinfo">
<tr>
<td width="100%" height="22" align="center">
<? echo $lang['game_info'] ?>
</td>
</tr>
<tr>
<td width="100%" height="140" class="gameinfo_cover">
<? echo "<a href='?p=game&id=".$games->id."'><img src='media/covers/".$games->cover."' alt=".$game->titel."'></a>"; ?>
</td>
</tr>
<tr>
<td width="100%" height="22" class="gameinfo1">
<b><? echo "<a href='?p=game&id=$games->id'>$games->titel</a>"; ?></b><br>
<b><? echo $lang['game_developer'] ?>:</b> <? echo "<a href='?p=company&id=$developer->id'>$developer->naam</a>" ?><br>
<b><? echo $lang['game_publisher'] ?>:</b> <? echo "<a href='?p=company&id=$publisher->id'>$publisher->naam</a>" ?><br>
<b><? echo $lang['game_publisher_nl'] ?>:</b> <? echo "<a href='?p=company&id=$publisher_nl->id'>$publisher_nl->naam</a>" ?><br>
<b><? echo $lang['game_genre'] ?>:</b> <? echo $games->genre ?><br>
<b><? echo $lang['game_release'] ?>:</b> <? echo $games->release ?><br><br>
<b><? echo $lang['game_max_players'] ?>:</b> <? echo $games->players ?><br>
<b><? echo $lang['game_online'] ?>:</b> <? echo $games->online ?><br>
<b><? echo $lang['game_lan'] ?>:</b> <? echo $games->lan ?><br>
<b><? echo $lang['game_downloads'] ?>:</b> <? echo $games->downloads ?><br><br>
<b><? echo $lang['game_esrb'] ?>:</b> <? echo $games->esrb ?><br>
<b><? echo $lang['game_esrb_reasons'] ?>:</b><br> <? echo "$games->esrb_reasons<br>" ?><br>
<b><? echo $lang['game_pegi'] ?>:</b> <? echo $games->pegi ?><br>
<?
}
}
}
}
?>
</td>
</table>
<?
}
elseif ($objtype == "company") {
$getcompanies = "SELECT * FROM companies WHERE id=$objid";
$sqlcompanies = mysql_query($getcompanies) or die (mysql_error());
while ($company = mysql_fetch_object($sqlcompanies)) {
?>
<table width="90%" class="rc_companyinfo">
<tr>
<td width="100%" height="22" align="center">
<? echo $lang['company_info'] ?>
</td>
</tr>
<tr>
<td width="100%" class="gameinfo_cover">
<? echo "<a href='?p=company&id=$company->id'><img src='media/companies/$company->logo' alt='$company->naam'></a>"; ?>
</td>
</tr>
<tr>
<td width="100%" class="gameinfo1">
<b><? echo "<a href='?p=company&id=$company->id'>$games->titel</a>"; ?></b><br>
</td>
</tr>
</table>
<?
}
}
elseif ($objtype == "gamesystem") {
$getgs = "SELECT * FROM gamesystems WHERE id=$objid";
$sqlgs = mysql_query($getgs) or die (mysql_error());
while ($gs = mysql_fetch_object($sqlgs)) {
?>
<table width="90%" class="rc_gsinfo">
<tr>
<td width="100%" height="22" align="center">
<? echo $lang['gs_info'] ?>
</td>
</tr>
<tr>
<td width="100%" class="gameinfo_cover">
<? echo "<a href='?p=gamesystem&id=$gs->id'><img src='media/gamesystems/$gs->foto' alt='$gs->naam'></a>"; ?>
</td>
</tr>
<tr>
<td width="100%" class="gameinfo1">
<b><? echo "<a href='?p=gamesystem&id=$gs->id'>$gs->naam</a>"; ?></b><br>
</td>
</tr>
</table>
<?
}
} else {
?>
<table width="90%" class="rc_info">
<tr>
<td width="100%" height="22" align="center">
<? echo $lang['content_info'] ?>
</td>
</tr>
<tr>
<td width="100%" class="gameinfo_cover">
<? echo "<img src='media/images/$content->img'>"; ?>
</td>
</tr>
</table>
</tr>
<?
}
?>
P.S. dit is niet de volledige code.