Searching Method in PHP ORM Architecture

Program 1

<?php 
  require 'dao.php';
  require 'model.php'
?> 
<html>
<body>
    <br><br><br><br><br><br><br><br><br><br>
    <center>
        <form method=post action="SelectStudent.php">
      <table border=1>  
        <tr>
            <th>Student Id</th>
            <td><input type=text name=txtid></td>
        </tr>
        <tr>
        <td></td>
        <td><input type=submit value=Search name=btnSubmit></td>
        </tr>
</table> 

<pre>
<?php

     if(isset($_POST['btnSubmit']))
     {
              $stid=$_POST['txtid'];
              $sd=new StudentDAO();
              $st=$sd->searchStudent($stid);  
      ?>  

         <table border=1>
                <tr>
                    <th>Roll No</th><th>Name</th><th>Phy</th><th>Chem</th><th>Maths</th>
               </tr>
              

     <?php 
           
                  echo "<tr>";
                   echo "<td>".$st->getrno()."</td>";
                   echo "<td>".$st->getname()."</td>";
                   echo "<td>".$st->getphy()."</td>";
                   echo "<td>".$st->getchem()."</td>";
                   echo "<td>".$st->getmath()."</td>";
                 echo "</tr>";
           

     }    
        
        
         
?>

</pre>
    </table>
</center>
</body>
</html>

 

courses
Image

TechVidvan Team

TechVidvan Team provides high-quality content & courses on AI, ML, Data Science, Data Engineering, Data Analytics, programming, Python, DSA, Android, Flutter, full stack web dev, MERN, and many latest technology.

Leave a Reply

Your email address will not be published. Required fields are marked *