views:

124

answers:

1

I'm trying to display records from a database and then when a new one is added automatically update the displayed records from the database with the new one

I am doing this using php and javascript. I want to load a page and display tags under a video and then when a user adds a new tag by entering it into text box to add it to the database and then refresh the part of the page which shows these tags and include the new one which has just been added all without the page being reloaded.

Thanks in advance for any help

+1  A: 

You will need to use Ajax and Javascript or a Javascript Framework like JQuery or Prototype to create HTML DOM Elements dynamically and show them to the user after the Ajax call returns the result.

UPDATE:

For JQuery + Ajax

--- Learning jQuery: 11 excellent resources

--- Simplify Ajax development with jQuery

--- Use jQuery and PHP to build an Ajax-driven Web page

For Example to create a HTML DOM Element in JQuery

var myLink = $("<a />");

//Add a link to it
myLink.attr('href', 'http://localhost/index.php');
//Add a text
myLink.text('Go Here');

//Add it to a div of id "myDiv"
$("#myDiv").append(myLink);

I hope this helps.

Colour Blend
I am using this link as my base how would I go from here to doing what you say?http://www.9lessons.info/2009/05/insert-and-load-record-using-jquery-and.html
Pete
Ok. I've been off for a while. First you have to learn how to create HTML DOM elements using JQuery, Then you have to learn how to retieve data using Ajax in conjunction with php as the server side language. I'll send you some links soon.
Colour Blend