Note that there are some explanatory texts on larger screens.

plurals
  1. POLoop through PHP function, display userdata from Mysql - limit to display to 25 items and add next button
    primarykey
    data
    text
    <p>I have this PHP function, which I use to display my userdata. If run once it will basicly display a div with the userdata in it.</p> <pre><code>function listings($fornavn, $efternavn, $email, $adresse, $tlf, $postnr, $city, $fodselsdag, $brugerid,$bartype,$idbar) { ?&gt; &lt;div class="container"&gt; &lt;span class="records" id="id-&lt;?php echo $brugerid;?&gt;"&gt; &lt;div class="customer bidDiv clearfix"&gt; &lt;?php if ($bartype=='temp_vip') { ?&gt; &lt;ul&gt; &lt;li&gt; &lt;span class="actionSpan" id="&lt;?php echo $brugerid;?&gt;" value="&lt;?php echo $idbar;?&gt;"&gt; &lt;a class="edit-opt" id="godkend" href="#"&gt;GODKEND&lt;/a&gt; &lt;/span&gt; &lt;/li&gt; &lt;li&gt; &lt;span class="actionSpan" id="delete-&lt;?php echo $brugerid;?&gt;" value="&lt;?php echo $bartype;?&gt;"&gt; &lt;a class="delete-opt" id="delete" href="#"&gt;Afvis&lt;/a&gt; &lt;/span&gt; &lt;/li&gt; &lt;?php }else{ ?&gt; &lt;ul&gt; &lt;li&gt; &lt;span class="actionSpan" id="delete-&lt;?php echo $brugerid;?&gt;" value="&lt;?php echo $bartype;?&gt;"&gt; &lt;a class="delete-opt" id="delete" href="#"&gt;Slet&lt;/a&gt; &lt;/span&gt; &lt;/li&gt; &lt;li&gt; &lt;a class="edit-opt" href="editform.php?id=&lt;?php echo $brugerid."&amp;bartype=".$bartype;?&gt;" rel="facebox"&gt;Rediger&lt;/a&gt; &lt;/li&gt; &lt;?php if ($bartype =='vip'){?&gt; &lt;li&gt; &lt;a class="print-opt" href="print.php?id=&lt;?php echo $brugerid;?&gt;" rel="facebox"&gt;Print&lt;/a&gt; &lt;/li&gt; &lt;?php }else{ // Dont render vip link }}?&gt; &lt;/ul&gt; &lt;p class="contact-data"&gt; &lt;?php echo $email;?&gt;&lt;br&gt; Tlf.: &lt;?php echo $tlf;?&gt; &lt;/p&gt; &lt;div class="base-data"&gt; &lt;h4&gt;&lt;?php echo ucwords($fornavn)." ".ucwords($efternavn);?&gt;&lt;/h4&gt; &lt;p&gt;Fødselsdag &lt;?php echo $fodselsdag;?&gt;&lt;/p&gt; &lt;address&gt;&lt;?php echo ucwords($adresse) ." ". $postnr ." ". ucwords($city);?&gt;&lt;/address&gt; &lt;/div&gt; &lt;/div&gt;&lt;!-- end customer --&gt; &lt;/div&gt; &lt;/span&gt; &lt;?php </code></pre> <p>I mostly use this function in a loop, to display all users from my MySQL database, who has a specific relation to something else.</p> <p>This is all working great. But currently it would pull all results at once. Right now I only have 5 members, so its no problem, but say I get 800 or 2000 members, the list of users would get very long.</p> <p>So I want to implement some kind of limit on how many users it displays, but still be able to browse through all the users. Many sites use something like pages and split up the results that way. Links like:</p> <pre><code>[1] [2] [3] [Last page&gt;&gt;] </code></pre> <p>I can't figure out how to start doing this? How would I proceed?</p> <p>Also looked into this Jquery plugin: <a href="http://andersonferminiano.com/jqueryscrollpagination/" rel="nofollow">http://andersonferminiano.com/jqueryscrollpagination/</a></p> <p>But it keeps reloading my PHP file which results in the Loops being restarted, and it simply displays the results over and over again endlessly.</p> <p>Can someone help me with the logic behind creating this? Or better, point me in a direction where I could use the jquery pluging above - where it only loads the loop one time, and renders the results as I scroll.</p> <p>Any help or pointers will be greatly appreciated!</p> <p>Thanks</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload