12. Create student table as follows Student(sno, sname, per).
Write
Ajax program to select the student name and print the selected student’s
details.
===============================================================
Html file :
<html>
<body>
<form
action="slip_12.php" method="get">
Enter student name Name:<input
type="text" name=sname><br>
<input
type="submit" value=submit>
</form>
</body>
</html>
Php file :
<?php
$sname=$_GET['sname'];
$con=mysql_connect("localhost","root","");
$d=mysql_select_db("bca_programs",$con);
$result=mysql_query("select
*from student where sname='$sname'");
while($row=mysql_fetch_array($result))
{
echo
$row['sno']."--".$row['sname']."--".$row['per']."<br>";
}
?>
sir can u tell me why you haven't took the sno and per in the form ?
ReplyDelete