Jump to content

need help with sql data

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
2 replies to this topic

#1
roma2509

roma2509

    Newbie

  • Members
  • Pip
  • 1 posts
Hello I have tehe code:
$qry = "SELECT brand_name, brand_logo, site_link, video_link FROM tableName where catagory = 'Taxi'";

$result = mysql_query($qry) or die (mysql_error());

while ($row = mysql_fetch_assoc($result)){

?>

<div id="categ">

    <div id="inside"><?php echo $row['brand_name']; ?></div>

    <div id="inside1"><a href="#"><img src="<?php echo $row['brand_logo']; ?>" /></a></div>

    <div id="inside2"><?php echo $row['short_desc']; ?> <a href="<?php echo $row['site_link']; ?>">continuare</a> </div>

    <div id="inside3"><a rel="shadowbox;width=405;height=340" title="Restaurant Daniel - New York, NY"   href="<?php echo $row['video_link']; ?>"><img src="img/tur_act.jpg" /></a></div>

    </div> 

<?php } ?>
This cod select from table all rows from a category and put it on a div how it is show in the attach.problem is that it shows all the rows for this category (Taxi) but I want to show for exeample 10 results per page and generate a numeric list that will create a link to next page that will show me next result for this category.

Attached Files



#2
Orjan

Orjan

    Writes binary right handed and hex left handed

  • Moderators
  • 3,299 posts
What you are looking for is called Pagination, and Jaan did a great tutorial that can be found here: http://forum.codecal...pagination.html
Read it and see if you get some better understanding!
__________________________________________
I study Information Systems at Karlstad University when I'm not on CodeCall

#3
kazhas

kazhas

    Newbie

  • Members
  • Pip
  • 1 posts
Thanks, that was helpful. I did mine with the help of that.