Salut, je suis nouveau dans ce forum et jespère pouvoir avoir des réponses a mes questions ;)
Mon soucis actuel est regardant la récupération de donnée MySQL pour ensuite la porter dans un tableau en HTML.
Mon code PHP suivant fonctionne parfaitement, mais maintenant j'aimerais l'incorporer dans le code HTML plus bas.
Code PHP:
<?php
require_once("config.php");
$query = "SELECT game_id, game_title, game_url, game_image, game_desc FROM mst_games";
$result = mysql_query($query);
while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
echo "Name : <b>{$row['game_title']}</b> <br>" .
"URL : <a href={$row['game_url']}>Click here</a> <br>" .
"Image : <img src={$row['game_image']}> <br><br>" .
"ID : <a href=\"../game.php?id={$row['game_id']}\">ID</a><br><br>";
}
?>
Et cela les liste comme suit:
Name :Bowman 2
Desc : Practice your aim
ID : 83
Name :Chav Hunter
Desc : Kill \'em all!
ID : 79
Name :Sniper Assassin 3
Desc : Long Range Killing Machine
ID : 81
Mainteant, j'aimerais faire la même chose, mais dans ce tableau: (sans utiliser echo)
(Les endroits ou sont les php game id / php game image / php game desc sont les endroit ou jai besoin d'avoir mes connées receuillies)
<table border="0" cellpadding="0" cellspacing="0"
height="92" width="225">
<tbody>
<tr>
<td bgcolor="#ececec" height="7" valign="top"
width="7"><img src="images/game_topleft.gif"
height="7" width="7"></td>
<td bgcolor="#ececec" valign="top"></td>
<td height="7" valign="top" width="7"><img
src="game_topright.gif" height="7" width="7"></td>
</tr>
<tr>
<td bgcolor="#ececec" valign="top"></td>
<td bgcolor="#ececec" valign="top">
<table border="0" cellpadding="0" cellspacing="0"
width="100%">
<tbody>
<tr>
<td height="70" valign="top"><a
href="game.php?id= php game id " class="game_title"> php game title </a><br>
<span class="style6" style="padding-right: 3px;"> php game desc </span></td>
<td height="70" valign="top"><a
href="game.php?id= php game id "><img
src=" php game image " alt=" php game title "
border="0" height="59" width="70"></a></td>
</tr>
<tr>
<td width="70"><a
href="game.php?id= php game id "><img
src="images/button_play.gif" alt="Play" border="0"
height="18" width="70"></a></td>
</tr>
</tbody>
</table>
</td>
<td bgcolor="#ececec" valign="top"></td>
</tr>
<tr>
<td height="7" valign="top" width="7"><img
src="images/game_botleft.gif" height="7" width="7"></td>
<td bgcolor="#ececec" valign="top"></td>
<td height="7" valign="top" width="7"><img
src="images/game_botright.gif" height="7" width="7"></td>
</tr>
</tbody>
</table>
Il serait très apprécié d'avoir un peu d'aide, cela fait des heures que j'essai différentes choses, mais aucun résultat.
Merci!
Configuration: Windows 7
Firefox 3.5.5