Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to update just one column of table generatedy by php/mysql with out reloading page/table?
    primarykey
    data
    text
    <p>So I have the following HTML table being generated with php getting data from a mysql table. And what I want to do is constantly update just that last row using ajax so that the table doesn't reload the entire table. </p> <pre><code>&lt;tbody&gt; &lt;?php while($row = MySQL_fetch_array($result)): $id = htmlentities($row['id']); $status = htmlentities($row['status']); include ("button.php"); ?&gt; &lt;tr&gt; &lt;td title="lname" width="100px"&gt; &lt;div style="width:100px; overflow:hidden;"&gt; &lt;?php echo(htmlentities($row['last_name'])); ?&gt; &lt;/div&gt; &lt;/td&gt; &lt;td width="100px"&gt; &lt;div style="width:100px; overflow:hidden;"&gt; &lt;?php echo(htmlentities($row['first_name'])); ?&gt; &lt;/div&gt; &lt;/td&gt; &lt;td width="100px"&gt; &lt;div style="width:100px; overflow:hidden;"&gt; &lt;?php echo(htmlentities($row['u_name'])); ?&gt; &lt;/div&gt; &lt;/td&gt; &lt;td width="100px"&gt; &lt;div style="width:150px; overflow:hidden;"&gt; &lt;?php echo(htmlentities($row['skype_id'])); ?&gt; &lt;/div&gt; &lt;/td&gt; &lt;td width="100px"&gt; &lt;div style="width:100px; overflow:hidden;"&gt; &lt;?php echo(htmlentities($row['primary_location'])); ?&gt; &lt;/div&gt; &lt;/td&gt; &lt;td&gt; &lt;div style="width:100px; overflow:hidden;"&gt; &lt;?php echo(htmlentities($row['phone'])); ?&gt; &lt;/div&gt; &lt;/td&gt; &lt;td&gt; &lt;div style="width:100px; overflow:hidden;"&gt; &lt;?php echo '&lt;div&gt;&lt;div id="r'.$id.'"&gt;&lt;div id="test"&gt;&lt;img class="rating" id="'.$status.$id.'" src="'.$color.'"&gt;&lt;div style="display:none;"&gt;'.$status.'&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;';?&gt; &lt;/div&gt; &lt;/td&gt; &lt;/tr&gt; &lt;?php endwhile; ?&gt; &lt;/tbody&gt; </code></pre> <p>I tried doing the following:</p> <pre><code>&lt;script&gt; $(document).ready(function(){ refreshTable(); }); function refreshTable(){ $('#test').load('response.php', function(){ setTimeout(refreshTable, 5000); }); } &lt;/script&gt; </code></pre> <p>Where response.php just had the entire while loop again. The problem with this were the following:</p> <p>1) After a few seconds, the page would get slower and slower...less and less responsive. And soon it would just grind to a halt. I have no idea why.</p> <p>2) The refresh is visible. All the table highlight blinks off for a moment at each refresh.</p> <p>So I thought, maybe if I just try refreshing the one column...it wouldn't grind to a halt? However, ever attempt I made to just update the column broke everything, all my scripts would stop working. And I'm not sure how to get rid of the issue of the table highlighting disappearing at refresh. How can I get this all to work?</p> <p>Thanks!</p>
    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.
    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