Jump to content

Search the Community

Showing results for tags 'page number'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. Hello everyone, I new to the php world and I'm only working with it for 5 days now. So I'm a noob But I've got a good start atm, I already could connect a database with my webpage and show all my coloms I need. Now I got a problem with the fact, my database is way to big to display on 1 page. To much load-time, so that's the reason why I want to split up all my products. 20 for each page, like in this tutorial: http://www.phpjabbers.com/php--mysql-select-data-and-split-on-pages-php25.html?err=1 I think I'm almost there, my problem is that when I click on the number from the next page (like nr 5), it doesn't show my next 20 products. But when I look to the url, that seems ok, because I get something like this; index.php?page=1 Can someone help me to find out, what I did wrong? And plz, remember, if you give me an answer, plz keep it short and simple. I'm a noob at this. This is my code: <?php include('connect-mysql.php'); if (!empty($_GET["page"])) { $page = $_GET["page"]; } else { $page=1; }; $start_from = ($page-1) * 20; $sqlget = "SELECT * FROM artikel, images LIMIT 0, 20 "; $sqldata = mysqli_query($dbcon, $sqlget) or die('error getting'); echo "<table>"; echo "<tr><th>A_ARTCODE</th><th>A_NUMMER</th><th>A_OMSCHRN</th><th>A_REFLEV</th><th>A_WINKEL</th><th>I_ARTCODE</th><th>I_FILE</th></tr>"; while($row = mysqli_fetch_array($sqldata)){ echo "<tr><td align='right'>"; echo $row['A_ARTCODE']; echo "</td><td align='left'>"; echo $row['A_NUMMER']; echo "</td><td align='left'>"; echo $row['A_OMSCHRN']; echo "</td><td align='left'>"; echo $row['A_REFLEV']; echo "</td><td align='right'>"; echo $row['A_WINKEL']; echo "</td><td align='right'>"; echo $row['I_ARTCODE']; echo "</td><td align='right'>"; echo $row['I_FILE']; //echo "<img src='000000-001000".$row['I_ID']."' />"; echo "</td></tr>"; } echo "</table>"; $sql = "SELECT COUNT(A_ARTCODE) FROM artikel"; $rs_result = mysqli_query($dbcon, $sql) or die ("mysqli query dies"); $row = mysqli_fetch_row($rs_result) or die ("mysqli fetch row dies"); $total_records = $row[0]; $total_pages = ceil($total_records / 20); for ($i=1; $i<=$total_pages; $i++) { echo "<a href='index.php?page=".$i."'>".$i."</a> "; }; ?> I hope someone can help me.
×
×
  • 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.