2moons.php:
<?php include("main/functions.php"); ?>
<?php
if ($_GET['strona']=='ogrze') {two_moons_ogrze();}
if ($_GET['strona']=='postacie') {two_moons_postacie();}
if ($_GET['strona']=='rozgrywka') {two_moons_rozgrywka();}
if ($_GET['strona']=='events') {two_moons_events();}
if ($_GET['strona']=='news') {two_moons_news();}
functions.php:
function two_moons_postacie() {
if(!$id){$id=0;}
mysql_connect ("", "", "") or die ("Nie potrafię się poł±czyć z baz± danych");
mysql_select_db ("") or die ("Blad w wybieraniu bazy danych: Usr_web_2");
$two_moons_postacie=mysql_query ("SELECT * FROM two_moons_postacie where id = $id") or die("Nie potrafię pobrać zapytania");
$ilosc_postaci = mysql_num_rows($two_moons_postacie);
$dane = mysql_fetch_assoc($two_moons_postacie);
$id = $dane[id];
$nazwa = $dane[nazwa];
$obrazek = $dane[obrazek];
$opis = $dane[opis];
if(!$nazwa){$nazwa="Nie ma gry o takim ID";}
echo('<table border="1" cellpadding="0" cellspacing="0" height="100%" width="100%">');
for ($postac=1; $postac <= $ilosc_postaci; $postac++ ) {
echo('<tr>');
echo('<td><center><b>');echo($nazwa);echo('</b></center></td>');
echo ('<td height="212" width="119">');print($obrazek);
echo ('<br>');
print($opis);
echo ('</td>');
echo ('</tr>');
}
echo ('</table>');
}
And when Im calling the function there is no table in the source 😮. So whats wrong now?