Web Analytics Made Easy -
StatCounter paginate results - CodingForum

Announcement

Collapse
No announcement yet.

paginate results

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • paginate results

    i have looked at the phpfreaks pagination tutorial, but i dont get how to just make page number links at the bottom and make the database info change when u change pages.....

    this is the page without pagination {really needs paginating}

    This website is for sale! whmx.com is your first and best source for all of the information you’re looking for. From general topics to more of what you would expect to find here, whmx.com has it all. We hope you find what you are searching for!

    -----------------------
    PHP Code:
    <?php
                    
      $con 
    mysql_connect("localhost","user","pwd");
                          
    $db mysql_select_db("whmx_store",$con);
                          
    $sql "SELECT * FROM `cds` WHERE `keywords` LIKE '%$q%' ";
                          
    $result mysql_query($sql) or die("Query Problem: ".mysql_error());
        while(
    $row mysql_fetch_array($result)){
                          
    $asin $row[7];
                          
    $theLocation="http://www.amazon.com/exec/obidos/tg/detail/-/$asin/1057thex-20/";
    $baseURL=""
    preg_match("/^(https?:\/\/)?([^\/]*)(.*)/i""$theLocation"$matches);
    $theDomain "http://" $matches[2];
    $page $matches[3];
    $fd fopen($theDomain.$page"r");
    $value "";
    while(!
    feof($fd)){
        
    $value .= fread($fd4096);    
    }
    fclose($fd);
    $startstrpos($value'<b class="price">');  
    $finishstrpos($value'</b>');  
    $length$finish-$start;
    $value=substr($value$start$length);
    $FinalOutput preg_replace("/(href=\"?)(\/[^\"\/]+)/""\\1" $theDomain "\\2"$value);    
                            echo 
    "<table width='100%' border='0' cellspacing='0' cellpadding='0'>";
                            echo 
    "<tr>";
                            echo 
    "<td align='center' width='23%' rowspan='3'><a class='three3' href='info.php?artist=$row[1]&album=$row[0]'><img src='$row[2]' border=1 width='50' height='49'></a></td>";
                            echo 
    "<td width='77%'><a class='three3' href='info.php?artist=$row[1]&album=$row[0]'><span class='searchTitle1'>$row[1] - $row[0]</span></a></td>";
                            echo 
    "</tr>";
                            echo 
    "<tr>"
                            echo 
    "<td>";                       
                            echo 
    "<span class='priceStyle2'>Price:</span><span class='priceStyle'> ".substr($FinalOutput,0,24)."</span>";
                              echo 
    "&nbsp;<a class='three3' href='buy.php?asin=$asin'><img src='buynow.gif' border=0></a>";
                            echo 
    "</td>";
                            echo 
    "</tr>";
                            echo 
    "<tr>";
                            echo 
    "<td height='27'><a class='three3' href='info.php?artist=$row[1]&album=$row[0]'><span class='searchTitle'>View More Details on This Album</span></a></td>";
                            echo 
    "</tr>";
                              echo 
    "</table>";
                            echo 
    "<hr color='orange' width='95%'>";
                            }
                            
    ?>
    Last edited by boeing747fp; Feb 14, 2004, 10:43 PM.
Working...
X