i want to display the mysql’s fetched results with php and html in unordered list and list format as like http://www.miniclip.com/games/en/. you can see in the all games categories in the footer in alphabetical order. the same requirement i do have. i guess i have written the logic its working fine. but i am unable to represent it properly. you can see in the following link above the footer. http://www.playtoongames.com/play1…
code:
<?php
$gameQuery = mysql_query ("SELECT name, LEFT(name, 1) AS first_char FROM games WHERE UPPER(name) BETWEEN 'A' AND 'Z' OR name BETWEEN '0' AND '9' ORDER BY name");
$current_char = '';
while ($gameRow = mysql_fetch_assoc($gameQuery)){
if ($_SESSION['lang'] == 'fr'){
$description = $gameRow['description_fr'];
}else{
$description = $gameRow['description'];
}
?>
<div style='float:left' title="<img src='<?php echo $gameRow['sitePath'];?>games/images/<?php echo $gameRow['img_100x75'];?>' width='230' height='112' class='thumb' alt='<?php echo $gameRow['name'];?>'/>" class='tooltip'>
<ul>
<li>
<a href='<?php echo $gameRow['sitePath'];?>play/<?php echo str_replace(' ','_',$gameRow['name']);?>'><?php echo $gameRow['name'];?></a>
</li>
</ul>
</div>
can anybody look into this…
Regards,
sam.
Well, I think the key is that there are 6 columns, which just means you’ll need to break your array into 6 different parts.
Here’s some psuedocode: