Why should I rely on PHPJabbers.com for all my PHP scripting needs? What do you offer me when buying some script?
  • Top quality scripts
  • Full demo before buying
  • Best pricing
  • Script customization
  • 7 days a week support
  • Installation support
  • Secure buying
  • PHP / MySQL select data and split on pages

    posted on 2006-12-31 10:29:11
    Comments
    Hiro Garabedian posted on 2007-09-30 01:04:30
    This site is really nice and friendly , offering a very good startups and hints and just for that I think a small contribution of purchasing offered products is the least we can do to keep it going on.
    Thank you I really appreciate it

    priyanka posted on 2007-09-19 11:14:44
    according to ur code clicking on page 2 ,the value is not pass into page everytime the value of page variable is 1

    Girish posted on 2007-09-18 12:13:17
    How can we select only 30%data from table
    ---------------------
    Veselin: you need to count how many rows the table has then calculate how many of them are 30% and then using LIMIT clause to SELECT only them.

    Alin posted on 2007-09-03 18:16:37
    Oh, problem was solved. And actually was pretty obvious. Cause if I have $page = $_GET['page'], then on the links i should add < a href="?id='.$row['id']&page='.$page.'" > meaning that $page is actually the page where we are in that moment.. :-)
    Thank you very much for this.
    Your site is *very* usefull.

    Alin posted on 2007-09-03 17:42:11
    This example is very usefull.
    However, in the page i'm using it, i have a problem.
    The page is a news section, looking like this:
    if(isset($GET['id'])) { $page = $_GET['id']; } else { $page = 'index'; }
    switch ($page) {
    case 'index':
    // Here are all the titles of the articles
    break;
    case ''.$row['id'].'':
    // Here is the complete article for every news.
    break; }
    The problem is, that when i try to view an article, on page.php?id=1..2.., this appears only if it's on the first page. (I have ORDER BY `id` DESC, and LIMIT every 10 titles per page.) If i have 20 articles, i have 2 pages. And if the article i want to view it's on news.php?page=2, appears without any problem. But if is in news.php?page=2, i can't view it, only if i access news.php?id=15&page=2. Finaly, my question is, how can I add these page= to the link of the titles ? cause if I add <a href="news.php?id='.$row['id'].'&page='.$i.'">Aticle</a> isn't working. Do i need to modify something ?
    Thank's for reading all this.

    Sean posted on 2007-08-28 21:10:26
    Thanks for the tutorial -- it got me started and I just modified it accordingly.

    Also, for anyone following this tutorial there is a spelling mistake at line 10 of the first code snippet:

    while ($row = mysql_fecth_assoc($rs_result)) {
    should be
    while ($row = mysql_FETCH_assoc($rs_result)) {

    Thanks for the tutorial, it\'s much appreciated.
    -------------------------
    Veselin: thanks for the spelling mistake report. I've fixed it !

    Frank posted on 2007-08-11 21:04:01
    Thank you it helps me a lot

    ac posted on 2007-08-09 21:35:38
    thank you, the logic you put here was simple and allowed me to fix a script from another tutorial,

    Thanx

    piad posted on 2007-06-28 12:24:23
    hi all,
    im beginner for php program..

    table_1

    bil main_menu sub_menu status
    1 class_A
    2 class_B
    3 class_B william sub_menu
    4 class_B ramjit sub_menu



    ok, how can i coding if i want the output referring the data from table_1 like this:-

    class_A
    class_B
    william
    ramjit



    TQ

    Tharan Ratnam posted on 2007-06-20 23:32:52
    This artlcle is realy good.I was using this in my all the projects.

    Pages:   1 2 3 4
       
    If you have any additions, suggestions or modifications for this example please contact us or use the form below.
       
    Your name:
    Your email: (email address will not be posted on the web site)
    Comment:
    Verification