小编典典
为了使用Ajax + jQuery检索数据,您应该编写以下代码:
$(document).ready(function() {
$("#display").click(function() {
$.ajax({ //create an ajax request to display.php
type: "GET",
url: "display.php",
dataType: "html", //expect html to be returned
success: function(response){
$("#responsecontainer").html(response);
//alert(response);
}
});
});
});
Manage Student Details
对于mysqli连接,请编写以下代码:
$con=mysqli_connect("localhost","root","");
为了显示数据库中的数据,您应该这样编写:
include("connection.php");
mysqli_select_db("samples",$con);
$result=mysqli_query("select * from student",$con);
echo "
Roll No | Name | Address | Stream | Status |
while($data = mysqli_fetch_row($result))
{
echo "
";echo "
$data[0]";echo "
$data[1]";echo "
$data[2]";echo "
$data[3]";echo "
$data[4]";echo "
";}
echo "
";?>
2020-05-17