Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!doctype html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>Untitled Document</title>
- </head>
- <body>
- <?php
- $ser=$_POST['s'];
- $conn=mysqli_connect('localhost','root',"","ccacs");
- if($conn->connect_error)
- {
- die("connection succesfull".$conn->connect_error);
- }
- $sql="SELECT * FROM student where id='$ser'";
- $res=$conn->query($sql);
- $c=0;
- while($row=mysqli_fetch_array($res))
- {
- $c++;
- echo "search successfull!!!<br><br><br>";
- echo "the details of the students are:";
- echo "student id:",$row[0]."<br>";
- echo "name".$row[1]."<br>";
- echo "mark".$row[2]."<br>";
- echo "grade".$row[3]."<br>";
- }
- if(!$c)
- {
- echo "no results found:";
- }
- $conn->close();
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement