回首忆惘然
要使用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
$con=mysqli_connect("localhost","root",""); if (!$con){
die('Could not connect: ' . mysqli_error());} ?>要显示数据库中的数据,您必须写下:<?php
include("connection.php");mysqli_select_db("samples",$con);$result=mysqli_query("select * from student",$con);echo "
Roll No | Name | Address | Stream | Status |
echo "
";echo "
$data[0]";echo "
$data[1]";echo "
$data[2]";echo "
$data[3]";echo "
$data[4]";echo "
";}echo "";?>