0

I have a table which is populated by values obtained from mysql database. I want to use an ajax call function so that when I click a cell - based on the cell value the textboxes get filled. Now the data in the textboxes will be from another table in the mysql database.

So an example of how it would work is:

I have one table for credentials, which shows user name and their user id.

On the website this is shown as a table. Now when i click the a cell which has a user name. The textbox would be populated by the users say total exams taken which is obtained from exams table in the mysql.

I am totally stumped on how to go about doing this. Please can someone help!

4

1 回答 1

0

您可以通过使用 ajax 来做到这一点。

用这个

$("#cell").click(function(){
$.get("file.php?id="+$(this).val(),function(data){
$("#textboxid").val(data);
})
})

file.php文件将对数据库执行反向调用并进行输出。

于 2012-10-25T14:44:36.483 回答