199234 Simple Pagination, PHP, MySQL
N/A
First please look at:
[login to view URL];load=false
Do you see the paginate numbers that should allow you to navigate through the pages? Those are just hardcoded in. This site has no paginate ability.
I also need the drop down menu to work. The one that allows you to choose flower sorting. It's to the right of the paginate.
I'll post the code here, as it is, as it needs to be fixed. Thank you very much in advance.
Here it is. Please paginate and sort! I welcome your bids.
<?php
$DatabaseServer = "XXXXX";
$Username = "XXXXXXX";
//$Password = "XXXXXXX";
$DatabaseName = "affiliate";
$link = mysql_connect($DatabaseServer, $Username, $Password) or die('Could not connect: ' . mysql_error());
mysql_select_db($DatabaseName) or die('Could not select database');
$cat = $_GET['catid'];
$load = $_GET['load'];
$subcat = $_GET['sub'];
$query = "SELECT ProductID, Name, ProductImage, ThumbNailImage, Price, Status FROM product WHERE Pcategories LIKE '%" . $cat ."%' and Status = '1' LIMIT 0,9";
$query2 = "SELECT * FROM categories WHERE CategoryId LIKE '%" . $cat ."%'";
$result = mysql_query($query) or die("FlowerPetal Query Failed");
$result2 = mysql_query($query2) or die("FlowerPetal Query #2 Failed");
// Retrieve the recordset
while ($row = mysql_fetch_assoc($result)){
$flowers[] = $row;
}
while ($row2 = mysql_fetch_assoc($result2)){
$flowers2[] = $row2;
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Send Flowers &gt;&gt; Send Fresh Flowers Online</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="keywords" content="send flowers, send flowers online, send flowers now, buy flowers, sends flower">
<meta name="description" content="Send Flowers Inc. is your best choice to send flowers online. Order and send fresh flowers with our secure delivery service.">
<link href="[login to view URL]" rel="stylesheet" type="text/css">
</head>
<body background="images/[login to view URL]">
<div align="center">
<table style="width:766px; height:1050px">
<tr>
<td width="766" height="192" style="background-image:url('images/[login to view URL]')" class="header">
&nbsp;<p><img border="0" src="images/[login to view URL]" width="291" height="95"></p>
<p><br>
<br style="line-height:9px">
<a href="[login to view URL]">
<img src="images/[login to view URL]" alt="Send Flowers Home" border="0" width="157" height="44" longdesc="Send Flowers Home"></a><a href="[login to view URL]"><img src="images/[login to view URL]" alt="About Send Flowers Inc." border="0" width="168" height="44" longdesc="About Send Flowers Inc."></a><a href="#"><img src="images/[login to view URL]" alt="" border="0" width="128" height="44"></a><a href="[login to view URL]"><img src="images/[login to view URL]" alt="Flower Articles" border="0" width="154" height="44" longdesc="Flower Articles and Knowledge Base"></a><a href="[login to view URL]"><img src="images/[login to view URL]" alt="Contact Us" border="0" width="159" height="44"></a><br>
</td>
</tr>
<tr>
<td width="766" height="31" bgcolor="#FFFFCC">
<table border="0" cellpadding="0" style="border-collapse: collapse" width="100%" id="table1">
<tr>
<td width="350" height="36" align="left" style="vertical-align: middle">
<h1><br>
<!----- name of arrangement type goes here ------------>
<?php
echo '&nbsp;&nbsp;';
echo $flowers2[0]['Name'];
?>
</h1>
</td>
<td height="36" align="left" style="vertical-align: middle">
<p align="center"> <font size="2">&nbsp;<img src="[login to view URL]" style="border: medium none" align="bottom" border="0">
1
2
3
4
5
6
7
8
9
10
11
<img src="[login to view URL]" style="border: medium none" align="bottom" border="0"> </font>
</td>
<td height="36" align="left" style="vertical-align: middle" width="171">
<p></p>
<p></p>
<p></p>
<p align="center"><font size="2">Price:</font><font size="3"><font size="2"><input type=hidden name=cid value=7><input type=hidden name=gc value="1"></font>&nbsp;
<select name=po style="font-family:Verdana,Arial,Helvetica,Geneva,Sans-serif,sans-serif;font-size:10px" onChange="doSubmit([login to view URL])">>
<option value="">Sort by:</option>
<option value="lh" >Low to High</option>
<option value="hl" >High to Low</option>
<option value="">&nbsp;</option>
<option value="u50" >Under $50</option>
<option value="50to75" >$50 - $75</option>
<option value="75to100" >$75 - $100</option>
<option value="o100" >over $100</option>
</select></font></td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="766" height="647">
<table border="0">
<tr>
<td width="1" height="573"></td>
<td width="193" height="573">
<table height="646">
<tr>
<td width="193" height="1"></td>
</tr>
<tr>
<td width="193" height="26" bgcolor="#CCFF99" class="set">
<div style="margin:8 0 0 12px "><strong>
<font color="#000000">Send Flowers by Occasion:</font></strong></div>
</td>
</tr>
<tr>
<td width="193" height="198" bgcolor="#518900" class="set">
<div style="margin:15 0 0 11px ">
<ul>
<li><font size="2">
<a href="[login to view URL];load=false">Winter</a></font></li>
<li><font size="2">
<a href="[login to view URL];load=false">Valentines Day</a></font></li>
<li><font size="2">
<a href="[login to view URL];sub=true&load=false">
Birthday</a></font></li>
<li><font size="2">
<a href="[login to view URL];load=false">Anniversary</a></font></li>
<li><font size="2">
<a href="[login to view URL];load=false">Congratulations</a></font></li>
<li><font size="2">
<a href="[login to view URL];load=false">Engagement</a></font></li>
<li><font size="2">
<a href="[login to view URL];load=false">New Baby</a></font></li>
<li><font size="2">
<a href="[login to view URL];load=false">New Job</a></font></li>
<li><font size="2">
<a href="[login to view URL];load=false">Housewarming</a></font></li>
<li><font size="2">
<a href="[login to view URL];load=false">Graduation</a></font></li>
</ul>
</div> <BR>
</td>
</tr>
<tr>
<td width="193" height="28" bgcolor="#CCFF99" class="set">
<strong>
<font color="#000000"> <div style="margin:8 0 0 12px ">Send
Flowers by
Sentiment:</div></font></strong></td>
</tr>
<tr>
<td width="193" height="132" bgcolor="#518900" class="set">
<div style="margin:15 0 0 11px "><ul>
<li><font size="2">
<a href="[login to view URL];load=false">Romance</a></font></li>
<li><font size="2">
<a href="[login to view URL];load=false">Thank You</a></font></li>
<li><font size="2">
<a href="[login to view URL];load=false">I&#39;m Sorry</a></font></li>
<li><font size="2">
<a href="[login to view URL];load=false">Just Because</a></font></li>
<li><font size="2">
<a href="[login to view URL];load=false">Get Well</a></font></li>
<li><font size="2">
<a href="[login to view URL];sub=true&load=false">Sympathy</a></font></li>
</ul>
</td>
</tr>
<tr>
<td width="193" height="26" bgcolor="#CCFF99" class="set">
<strong>
<font color="#000000"> <div style="margin:8 0 0 12px ">Send
Flowers by Type:</div></font></strong></td>
</tr>
<tr>
<td width="193" height="224" bgcolor="#518900" class="set">
<div style="margin:15 0 0 11px ">
<ul>
<li><font size="2">
<a href="[login to view URL];load=false">Roses</a></font></li>
<li><font size="2">
<a href="[login to view URL];alt=Daisy">
Daisies</a></font></li>
<li><font size="2">
<a href="[login to view URL]">
Carnations</a></font></li>
<li><font size="2">
<a href="[login to view URL];load=false">Lilies</a></font></li>
<li><font size="2">
<a href="[login to view URL];load=false">Orchids</a></font></li>
<li><font size="2">
<a href="[login to view URL]">
Violets</a></font></li>
<li><font size="2">
<a href="[login to view URL];sub=true&load=false">Plants</a></font></li>
<li><font size="2">
<a href="[login to view URL];load=false">Everyday
</a></font></li>
<li><font size="2">
<a href="[login to view URL];load=false">Gift Baskets</a></font></li>
<li><font size="2">
<a href="[login to view URL]">
Wreaths</a></font></li>
<li><font size="2">
<a href="[login to view URL];load=false">Centerpieces</a></font></li>
</ul>
</div> </td>
</tr>
<tr>
<td width="193" height="1"></td>
</tr>
<tr>
<td width="193" height="1"></td>
</tr>
</table>
</td>
<td width="3" height="573"></td>
<td width="568" height="573" valign="top">
<table>
<tr>
<td width="568" height="3" colspan="5"></td>
</tr>
<? if ($flowers){
echo '<tr>';
foreach ($flowers as $key=>$value){
if ($key and !($key%3)){
echo '</tr><tr>';
echo '<td width="568" height="3" colspan="5"></td>';
echo '</tr><tr>';
}
echo '<td width="187" height="187" align="center" class="border1">';
echo '<br style="line-height:11px">';
echo '<a href="[login to view URL]' .$value['ProductID']. '">';
echo '<img src="[login to view URL]'.$value['ThumbNailImage'].'" alt="' .$value['Name'] . '" border="0"></a><br>';
echo '<br style="line-height:6px">';
echo '<b><a href="[login to view URL]' .$value['ProductID']. '">';
echo '<font color="#000000">'.$value['Name'].'</a></b><br>';
echo '<br style="line-height:7px">';
echo '<font color="#FF0000">$<b>'.number_format($value['Price'],2,"."," ").'</font> delivered</b></font><br>';
echo '<a href="[login to view URL]' .$value['ProductID']. '"><img border="0" src="images/[login to view URL]" width="13" height="14" valign="4"></a>';
echo '&nbsp;<a href="[login to view URL]' .$value['ProductID']. '">more info</a><BR>';
echo '<br></td>';
echo '<td width="4" height="187"></td>';
}
if ($x = count($flowers)%3) echo '<td colspan="'.(3-$x).'">&nbsp;</td>';
echo '</tr>';
echo '<tr>';
echo '<td width="568" height="3" colspan="5"></td>';
echo '</tr>';
}else{
echo '<tr><td align="center"><BR><BR><h2>Sorry. No items match your search.</h2><BR><BR></td></tr>';
echo '<br><B><font size = 2>' .$query. '</font>';
}
?>
</table>
</td>
<td width="1" height="573"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="766" height="194">
<table height="189" style="border-width: 1px" bordercolor="#000000">
<tr>
<td width="197" height="22" bgcolor="#008000">
&nbsp;</td>
<td width="569" height="22" class="footer" bgcolor="#008000">
&nbsp;</td>
</tr>
<tr>
<td width="197" height="148" bgcolor="#FFFFCC">
<p align="center"><a href="[login to view URL]">
<img border="0" src="images/[login to view URL]" width="142" height="142" alt="breast cancer awareness"></a></td>
<td width="569" height="148" class="footer" bgcolor="#FFFFCC">
&nbsp;<p>&nbsp;</p>
<p align="center">&nbsp;</p>
<p align="center">&nbsp;</p>
<p align="center">Copyright © 2008 Send Flowers [login to view URL] | <a href="[login to view URL]">
Privacy Notice</a> | <a href="#">Conditions of Use</a></td>
</tr>
<tr>
<td width="197" height="19" bgcolor="#008000">
<br>
</td>
<td width="569" height="19" class="footer" bgcolor="#008000">
<p align="center">
<br>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<?php
mysql_free_result($result);
mysql_free_result($result2);
mysql_close();
?>
</body>
</html>
</html>
Project ID: 1945455
About the project
1 proposal
Remote project
Active 12 yrs ago
Looking to make some money?
Benefits of bidding on Freelancer
Set your budget and timeframe
It's free to sign up and bid on jobs