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 is the page without pagination {really needs paginating}
-----------------------
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($fd, 4096);
}
fclose($fd);
$start= strpos($value, '<b class="price">');
$finish= strpos($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 " <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%'>";
}
?>