
jQuery Ajax? ???? MySQL?? ??? ??
jQuery Ajax? ???? MySQL ???????? ???? ????? ??? ??? ???. ??:
1. Ajax ?? ??:
$.ajax() ??? ???? Ajax ??? ?????. ??(GET/POST), URL(??? ?? ??) ? dataType(?? ?? ??)? ?????. ???? ??? ??? ?? ??? ?????.
2. MySQL ?? ??:
MySQL ??? ?? mysqli ??? ?????. mysqli_connect()? ???? ??? ?????.
3. ?????? ?? ??:
mysqli_query() ??? ???? MySQL ????? ???? ???? ??? ?????. ? ??? ??? ???? ???? ??? ???? ???.
4. ??? ??? ??:
??? ???? ?? ??? ???? ???? ???? ???? ?????. ??? ??? ?? ???? ???? ?? ??? ????.
?? ??:
<script type="text/javascript">
$(document).ready(function() {
$("#display").click(function() {
$.ajax({
type: "GET",
url: "display.php",
dataType: "html",
success: function(response) {
$("#responsecontainer").html(response);
}
});
});
});
</script>
<body>
<button>
<?php
$con = mysqli_connect("localhost", "root", "");
mysqli_select_db($con, "samples");
$result = mysqli_query($con, "SELECT * FROM student");
echo "<table border='1'>";
echo "<tr><th>Roll No</th><th>Name</th><th>Address</th><th>Stream</th><th>Status</th></tr>";
while ($row = mysqli_fetch_row($result)) {
echo "<tr>";
foreach ($row as $value) {
echo "<td>$value</td>";
}
echo "</tr>";
}
echo "</table>";
?>
?? ??? ??? ??? ?? ??? ???? ????? ??? ? ????. jQuery Ajax? ???? MySQL ??????? ???? ?????.
? ??? jQuery Ajax? ???? MySQL ???? ???? ??? ??????? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!