Autor Zpráva
Jamanek
Profil *
Zdar všem. Mohli by jste mi někdo poradit. Potřebuju aby si mi
vypsalo dané id z dané tabulky databáze. Po zadání neco.php?id=1
například. Šlo by to předělat z tohoto scriptu ? :
<table border="0" cellpadding="0" cellspacing="0"
width="760" height="61">
<tr>
<td width="760" height="13" valign="top" colspan="2">
<p align="center">
<img src="./Images/Java_Games.png" title="Java Aplikace"
alt="Java Aplikace"></td>
</tr>
<tr>
<td width="760" height="13" valign="top" colspan="2">
<p align="center">
<?php

$query = "SELECT * FROM javagame GROUP by styl ORDER BY ID asc";
$result = mysql_query($query, $spojeni) or die("MySQL dotaz nešlo
provést");

echo "<center><span class=Normal-Text>";
while ($row=mysql_fetch_array($result))
{
echo "<A
href=index-prihlaseno.php?pageid=games&styl=".$row["styl"].">".
$row["styl"]."</A> ";
}

echo "</span></center><br><br>";

$query2 = "SELECT * FROM javagame WHERE styl = '$styl' ORDER BY
ID asc";
$result2 = mysql_query($query2, $spojeni) or die("MySQL dotaz nešlo
provést");

while ($row2=mysql_fetch_array($result2))
{

echo

?>
<center>
<table border="0" cellpadding="0" cellspacing="0"
width="500" height="14">
<tr>
<td width="28" height="19" valign="top">
<span class="Normal_Text">
<img src="./Images/Pravy_Okraj.png" title=""
alt=""></td>
<td width="439" height="19" valign="midlle"
background="./Images/Pozadi_Ramecku.png">
<img src="./Images/Tecicky_Male.png" title=""
alt=""><span class="Normal_Text">&nbsp;<?php echo
$row2["nazev"]; ?></span></td>
<td width="33" height="19" valign="top">
<img src="./Images/Levy_Okraj.png" align="left"></td>
</tr>
<tr>
<table border="0" cellpadding="0" cellspacing="0"
width="500" height="47">
<tr>
<td width="68" height="47" valign="middle"
rowspan="2">
<p align="center">
<?php
if (($row2["obrazek"])!="") { echo "<img
src=".$row2["obrazek"]." title=\"Java Hra\" alt=\"Java
Hra\">";}
?></td>
<td width="432" height="32" valign="top" colspan="2">
<span class="Normal_Text">
<?php echo $row2["popis"]; ?><br>
Velikost: <?php echo $row2["velikost"]; ?>KB<br>
MultiPlayer: <?php echo $row2["multiplayer"]; ?><br>
<hr color="#000000" width="75%">
</span>
</td>
</tr>
<tr>
<td width="391" height="15" valign="top"><span
class="Normal_Text">WAP: <br><?php echo $row2["download"];
?></span></td>
<td width="41" height="15" valign="top"><span
class="Normal_Text"><a href=<? echo $row2["download"]; ?>
target="_blank"><img src=./Images/disketa-cd.png
border=0></a></span></span></td>
</tr>
</table>
</tr>
</table>
<br>
<br>

<?php
}


?>
Charlie
Profil
Přidáš proměnnou, změníš query:
$id = $_GET['id'];
1) SELECT * FROM javagame WHERE id = '$id' GROUP BY styl
2) SELECT * FROM javagame WHERE styl = '$styl' and id = '$id' ORDER BY ID asc
Toto téma je uzamčeno. Odpověď nelze zaslat.

0