Jump to content

How to do paging in a PHP...!


asad_black

Recommended Posts

this my code in this searching is perform now i want to do paging.

 

<?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'];// here we will insert of the description

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'];// here we will insert of the description

echo "</center>";

echo "</td>";

 

  }

  echo "</tr>";

  echo "</table>";

mysql_close($con);

?>

Link to comment
https://forums.phpfreaks.com/topic/145535-how-to-do-paging-in-a-php/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.