Updating Table

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
staggan
Forum Newbie
Posts: 7
Joined: Tue Jul 27, 2010 2:29 pm

Updating Table

Post by staggan »

Hello

I am trying to update a table without having to update the whole page...

This is the table...

<div id="FriendsTable">

<table id="friendslist" width="730" border="0" background="XXXXXX">
<tr>
<td width="75"><a href="#" onclick="downlist()"><img src="XXXXXXX" width="38" height="38" alt="Left" /></td>
<td width="75"><? echo $friendsslice[0]; ?></td>
<td width="75"><? echo $friendsslice[1]; ?></td>
<td width="75"><? echo $friendsslice[2]; ?></td>
<td width="75"><? echo $friendsslice[3]; ?></td>
<td width="75"><? echo $friendsslice[4]; ?></td>
<td width="75"><a href="#" onclick="uplist()"><img src="XXXXX" alt="right" width="38" height="38" align="Right" /></td>
</tr>
</table>

</div>

Essentially what I am trying to do is have a table of friends names, and in that table show a slice of those friends, and with a click of the left / right button, move that slice up and down through my complete list of friends.....

On clicking the left or right button I call a small javascript function... which uses PHP to give me a new slice of my overal friends list...

<script type="text/javascript">
function uplist()
{
<?
$friendsslice = array_slice ($friends, ($list_start+=1), ($list_end));
tableRefresh();
?>
}
</script>

I have a function called tableRefresh() set aside to refresh the table content after a new slice has been selected.. but I have no idea how to actually make that function...

Any ideas?

Thanks
Sephern
Forum Commoner
Posts: 73
Joined: Sun Jan 04, 2009 4:44 pm

Re: Updating Table

Post by Sephern »

Look into AJAX.
Post Reply