Member Avatar for kirtan_thakkar

How to print more than one results in a page??
I want to print 10 results per page and show next button if it have more than 10 results..
In the next button it will show another 10 results..
How to code it..??
And please explain the code if you can...
It will my skills to generate my code..

I have a table and three fields..
id, name and info..
name is the one from witch i want to show results..
because it repeats in the data.. It repeats so many times..

Recommended Answers

All 5 Replies

Member Avatar for rajarajan2017
$query = "SELECT * FROM symbols";

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

// see if any rows were returned 
if (mysql_num_rows($result) > 0) { 
    // yes 
    // print them one after another 
    echo "<table cellpadding=10 border=1>"; 
    while($row = mysql_fetch_row($result)) { 
        echo "<tr>"; 
        echo "<td>".$row[0]."</td>"; 
        echo "<td>" . $row[1]."</td>"; 
        echo "<td>".$row[2]."</td>"; 
        echo "</tr>"; 
    } 
    echo "</table>"; 
} 
else { 
    // no 
    // print status message 
    echo "No rows found!"; 
}

This is the logic to show all records, split up to 10 by implementing the logic

Member Avatar for kirtan_thakkar

I know how to put 10 results but have to print the next button for the next 10 results..

Member Avatar for rajarajan2017

Add a button at the 11th row.

Member Avatar for kirtan_thakkar

in the 11th row what to link to show the next results..

Member Avatar for rajarajan2017

Again generate the loop for next 10 records

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.