Under the php condition, how can I click the record name on the left and the specific content is displayed on the right of the page?

Source: Internet
Author: User
Under the php condition, how does one click the record name on the left and the specific content is displayed on the right of the page? I made a webpage. the column on the left is the record name displayed one by one. it is read from mysql through a loop statement and displayed in each row. The right side is the specific content framework of each record (that is, many blank boxes ). To achieve this goal, click any record name on the left. in the empty boxes on the right, you can see how to click the record name on the left under the php condition, what is displayed on the right of the page?
I made a webpage. the column on the left is the record name displayed one by one. it is read from mysql through a loop statement and displayed in each row. The right side is the specific content framework of each record (that is, many blank boxes ). The goal is to click the name of any record on the left, the specific content of the record is displayed in the empty boxes on the right (in fact, the content of each field is filled in each blank box ).
What simple framework should be used to implement the record name on the left? Then, what variables are passed to control the reading records and read the specific records from mysql? (it seems that this record content is not difficult to display in various empty boxes, can I do this )? Of course, the specific content of each record already exists in mysql. you can query it.


Please help me more. this is the first time I have asked, it's urgent. Thank you. Share:
------ Solution --------------------
Demo address http://www.colg.biz/demo/d1.php

Code

Display Page

header("Content-Type:text/html;charset=utf-8");
mysql_connect('localhost','colg_demo','colg__');
mysql_select_db('colg_demo');
function getdata($sql)
{
$result=mysql_query($sql);
if($result)$count = mysql_num_rows($result);
for($i=0;$i<$count;$i++)
{
mysql_data_seek($result,$i);
$data[$i] = mysql_fetch_assoc($result);
}
return $data;
}

$data = getdata("select * from demo");

?>

.left{float:left;width:100px;border:1px solid grey;height:300px;}
.right{float:left;width:800px;border:1px solid grey;height:300px;margin-left:15px;}
.left_button{margin:5px;border:1px solid #ccc;cursor:pointer;}
td{margin:1px;border:1px solid #ccc;}


《script》

$(document).ready(function(){
$(".left_button").click(function(){
$(this).css("background","#EEE");
$(this).siblings().css("background","white");
var n = $(this).text();
$.ajax({
type:"get",
url:"ajax.php",
data:{
n:n
},
success:function(msg){
msg = eval("("+msg+")")
$(".show_tr").html(msg);
}
});
});

});

《script》









id

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.