0

Dear admins..!! i am sorry for my previous post, but, now i am asking you this because i am poor in JS scripting.... i have seen a website. Here the menu and content are displayed in two different DIVs, but, i cant understand how to use that, i have concerned my friends and masters too, byt, they also did not understand how to apply, so, can you help me out in intgrating these both files.

Please....

index.php

<ol>
<?php


mysql_connect('localhost','root','');

mysql_select_db('munnajax_fetch');

$query = "select * from interndb";
$result = mysql_query($query);

while ($row = mysql_fetch_array($result))
{
    echo "<li><a href='description.php?id=$row[id]'>$row[by]</a></li>";
}
echo "<br>";
?>
</ol>

<div id="targetspace">Description should come here</div>

description.php

<table width="400">
<?php


mysql_connect('localhost','root','');

mysql_select_db('munnajax_fetch');

$id = $_REQUEST['id'];

$query = "select * from interndb where id='$id'";
$result = mysql_query($query);
$row = mysql_fetch_array($result);

echo "<tr><th>Intern By</th><td>$row[by]</td></tr>";
echo "<tr><th>Position</th><td>$row[title]</td></tr>";
echo "<tr><th>Duration</th><td>$row[duration]</td></tr>";
echo "<tr><th>Detailed Description</th><td>$row[desc]</td></tr>";


?>
</table>
4
Contributors
3
Replies
6
Views
4 Years
Discussion Span
Last Post by radhakrishna.p
0

if it's populated at runtime just do this:

<div id="targetspace"><?php include description.php; ?></div>
0

replace your code with the following code at lineno:14

<a href="#" onclick="getDescription('$row[id]')">$row[by]</a> </li>

and write a javascript function which internally coded ajax concept for getting data of a particular id (as said by pritaeas)

and place ajax result data to the target div

i think you got the concept now

please try it once i hope you will get the answer

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.