Searching Method in PHP ORM Architecture
by TechVidvan Team
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>
Tags: orm architectureorm architecture in phpPHPphp orm architecturephp practicalphp programsearching methodsearching method in orm architecturesearching method in php orm architecture
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.