0

I have a database and will search with that database..
I want to show only first 5 results in the page and generate the "next" button for the next 5 results and on the 6-10 results page generate "next" button for the next results and the "previews" button for the previews results..

Can any one code it in php..??

My table have three fields
one field is name.....
So want to display results via name because name repeats many times..

Edited by kirtan_thakkar: n/a

3
Contributors
5
Replies
6
Views
7 Years
Discussion Span
Last Post by kirtan_thakkar
0

i have the code but no time to edit to fit your 3 fields ... can i give you to do the editing yourself...

0

Yes, Sure..
Thank you

0

i have the code but no time to edit to fit your 3 fields ... can i give you to do the editing yourself...

Yes, Sure..
Thank you

0
<?php

$link = mysql_connect("localhost", "user", "pass") or die("Could not connect".mysql_error());
mysql_select_db("user") or die("Could not select Database");


include("index.php");

$query = "SELECT * FROM all WHERE name='Kirtan' ORDER BY id";

// execute query 
$result = mysql_query($query) or die ("Error in query: $query. ".mysql_error()); 

echo "<center><font face=verdana><table>";


for($n=1;$n<=5;$n++)
{
 $row =  mysql_fetch_object($result);
          
 $id = $row -> id ;

 $name = $row -> name ;

 $info = $row -> info ;

echo "<tr><tr><td>Result No:".$n;
echo("and ID:");
echo($id);
echo("<tr><td> * ");
echo($info);
echo("<tr><td align=center>-");
echo($name);

}

And I have to create a page for the next five results...

Edited by kirtan_thakkar: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.