在同一页面上加载结果

not much code with this one,

I have a database that I load all the names and id's of into my page, how could I make the user be able to click one of these and it load the description to go along with the title, without page refresh.

so far I have...

  echo "<div id=\"t".$row['Films_ID']."\"><a href=\"#\">".$film_name."</a></div>";

this is in a loop that cycles through all the rows in the table, how would i load the $film_information into a seperate div when that link is pressed?

Thanks for your time guys.

use "onclick" event on this link, which will load a function in Javascript that connects to other page written on php and gets the data from it. In order to do it without refreshing the page you will have to use a technology that is called Ajax. Good luck.

Like this...

JavaScript:

function LoadDescription(){

    var row = $(this).attr("id").substring(1); // removes the 't' from the ID leaving the value of 'Films_ID' for that row.

    $("#information").load("url/of/page/to/load.php?ID="+row+"");

}

PHP:

$row = $_GET['ID'];

// mysql query to select information related to the ID.

// echo the info etc...

NOTE: The link isn't necessary; this would be assigned to the onClick of the div.