PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
asad_black
Forum Newbie
Posts: 20 Joined: Wed Feb 11, 2009 1:59 am
Post
by asad_black » Tue Feb 17, 2009 3:55 am
this my code in this searching is perform now i want to do paging.
Code: Select all
<?php
$var = @$_GET['q'] ;
$trimmed = trim($var);
$con = mysql_connect("localhost","sample","sample");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("sample", $con);
$sql = mysql_query("SELECT * FROM links where kw like \"%$trimmed%\"");
echo "<table border=0 cellspacing=5>";
echo "<tr>";
while($row = mysql_fetch_array($sql))
{
echo "<td class=style28 width=200>";
echo "<center>";
echo $row['text'];
echo"</center>";
echo "<a href=\"" . $row["link"] . "\"><br>
<center><img src=\"" . $row["image"] . "\" height='80' width='80' border=0 alt=\"" . $row["text"] . "\">
</a>" ;
echo $row['des'];
echo "</center>";
echo "</td>";
}
echo "</tr>";
echo "</table>";
mysql_close($con);
?>
Paul Arnold
Forum Contributor
Posts: 141 Joined: Fri Jun 13, 2008 10:09 am
Location: Newcastle Upon Tyne
Post
by Paul Arnold » Tue Feb 17, 2009 5:57 am
There are plenty of pagination classes out there.
Have a search on Google.
susrisha
Forum Contributor
Posts: 439 Joined: Thu Aug 07, 2008 11:43 pm
Location: Hyderabad India
Post
by susrisha » Tue Feb 17, 2009 8:01 am
There are many available in the code critique module of the forum.. try to search the forum first then google it out..