PHP Project – Book Searching Application
by TechVidvan Team
Program 1
<html>
<body>
<center>
<font color=red size=10>B</font><font color=black size=10>o</font><font color=green size=10>o</font><font color=blue size=10>k</font>
<font color=black size=10>S</font>
<font color=red size=10>e</font>
<font color=green size=10>a</font>
<font color=blue size=10>r</font>
<font color=black size=10>h</font>
<form method=post action=BookSearch.php>
<textarea rows=2 cols=100 name=txtname></textarea>
<br>
<input type=submit value="Search" name=btnSubmit>
</form>
<pre>
<?php
if(isset($_POST['btnSubmit']))
{
$mycon=mysqli_connect("localhost","root","","Library") or die("Connection not success");
$bookname=$_POST['txtname'];
$sql="select * from bookinfo where bookname like '".$bookname."%'";
$record=$mycon->query($sql);
if(mysqli_num_rows($record)>0)
{
?>
<table border=1>
<tr><th>Book Id</th><th>Book Name</th><th>Author Name</th><th>Book Price</th><th>Edition</th></tr>
<?php
while($row=mysqli_fetch_assoc($record))
{
echo "<tr>";
echo "<td>". $row['Bookid']."</td>";
echo "<td>". $row['Bookname']."</td>";
echo "<td>". $row['AuthorName']."</td>";
echo "<td>". $row['BookPrice']."</td>";
echo "<td>". $row['BookEdition']."</td>";
echo "</tr>";
}
}
else
echo "<font color=red size=5>Book not found</font>";
}
?>
</pre>
</table>
</center>
</body>
</html>
Tags: book searching applicationbook searching application projectPHPphp book search appphp book searching applicationphp book searching application projectphp practicalphp programphp project
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.