Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to use ajax to update this page?
    primarykey
    data
    text
    <p>hi so i managed to figure out my biggest problem and i am happy its pretty much working the way i want. Now the second stage to reach my goal is for me to be able to update the page without a refresh using ajax. The php etc is below, can someone show me or point me in the right direction. Thanks .</p> <pre><code>&lt;?php $link = mysqli_connect('localhost','root','password','database'); if (mysqli_connect_errno()) { echo 'Error: Could not connect to database. Please try again later'; exit; } $db = mysqli_select_db($link, "database"); //check if the starting row variable was passed in the URL or not if (!isset($_GET['feedback']) or !is_numeric($_GET['feedback'])) { //we give the value of the starting row to 0 because nothing was found in URL $feedback = 0; //otherwise we take the value from the URL } else { $feedback = (int)$_GET['feedback']; } $prev = $feedback - 4; $query = "SELECT * FROM clients, orders WHERE clients.ID = orders.ID ORDER BY Date DESC LIMIT $feedback,4"; $result = mysqli_query($link,$query); ?&gt; &lt;div class="sidebar"&gt; &lt;div class="clientwrapper"&gt; &lt;h2&gt;Client Feedback&lt;/h2&gt; &lt;div class="box"&gt; &lt;?php while($row=mysqli_fetch_array($result)){ echo '&lt;p&gt; '.$row["Comments"].' &lt;span class="name"&gt; By '.$row["Organisation"].' &lt;/span&gt;&lt;/p&gt;'; } ?&gt; &lt;?php echo '&lt;a class="nodecoration" href=" '.$_SERVER['PHP_SELF'].'?feedback='.($feedback+4).'" &gt;&lt;span class="next-button"&gt;More&lt;/span&gt;&lt;/a&gt;' ?&gt; &lt;?php if ($prev &gt;= 0) echo '&lt;a class="nodecoration" href=" '.$_SERVER['PHP_SELF'].'?feedback='.$prev.'" &gt;&lt;span class="prev-button"&gt;&lt;/span&gt;&lt;/a&gt;' ?&gt; &lt;div class="clear"&gt;&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="announcewrapper"&gt; &lt;h2&gt;Announcements&lt;/h2&gt; &lt;div class="box"&gt; &lt;p&gt;There are currently no announcements.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </code></pre>
    singulars
    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