Repository navigation
Expand file tree
/
Copy pathsearchbook.php
More file actions
131 lines (122 loc) · 3.74 KB
/
Copy pathsearchbook.php
File metadata and controls
131 lines (122 loc) · 3.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<!DOCTYPE html>
<!-- Template by freewebsitetemplates.com -->
<html>
<head>
<meta charset="UTF-8" />
<title>Home - NYC Library</title>
<link rel="styleshee" type="text/css" href="style.css" />
<!--[if IE 6]>
<link rel="stylesheet" type="text/css" href="ie6.css" />
<![endif]-->
<style type="text/css">
<!--
.style1 {font-size: 24px}
-->
</style>
</head>
<body style="background-color:lightblue">
<div id="page">
<div id="header">
<div id="section">
<div><a href="index.html"><img src="images/online lib.jpg" alt="Logo" width="315" height="56" /></a></div>
<p><span style="text-align:right">jlahoti@nyit.edu</br>+1551-998-7500</span>
</p>
</div>
<ul>
<li><a href="search.php">Search</a></li>
<li><a href="home.php">Quit</a></li>
</ul>
<div id="tagline">
<div>
<h4>Welcome to Library.</h4>
</div>
</div>
</div>
<body>
<p> </p>
<p> </p>
<div align="center"><br>
<?php
$host="localhost";
$user="root";
$pass="";
$conn=mysql_connect($host,$user,$pass);
$db=mysql_select_db("elib");
$id = $_REQUEST['id'];
$title = $_REQUEST['title'];
$publisher = $_REQUEST['publisher'];
if($id)
{
$sel="select * from book where book_id=".$id;
$query=mysql_query($sel);
while($row=mysql_fetch_array($query))
{
?>
<table bgcolor="green" border="3">
<tr><td>Book title</td><td><?php echo $row['title']; ?></td></tr>
<tr><td>Publisher Name</td><td><?php echo $row['publisher_name']; ?></td></tr>
<tr><td>Publisher date</td><td><?php echo $row['publisher_date']; ?></td></tr>
<tr><td>Publisher Address</td><td><?php echo $row['publisher_address']; ?></td></tr>
<tr><td>No Of Copies</td><td><?php echo $row['no_of_copy']; ?></td></tr>
<tr><td>ISBN</td><td><?php echo $row['isbn']; ?></td></tr>
</table>
<?php echo $row['title']; ?>
<?php
}
}
else if($title)
{
//echo $title;
$sel="select * from book where title='".$title."'";
$query=mysql_query($sel);
while($row=mysql_fetch_array($query))
{
?>
<table bgcolor="orange" border="3">
<tr><td>Book title</td><td><?php echo $row['title']; ?></td></tr>
<tr><td>Publisher Name</td><td><?php echo $row['publisher_name']; ?></td></tr>
<tr><td>Publisher date</td><td><?php echo $row['publisher_date']; ?></td></tr>
<tr><td>Publisher Address</td><td><?php echo $row['publisher_address']; ?></td></tr>
<tr><td>No Of Copies</td><td><?php echo $row['no_of_copy']; ?></td></tr>
<tr><td>ISBN</td><td><?php echo $row['isbn']; ?></td></tr>
</table>
<?php echo $row['title']; ?>
<?php
}
}
else if($publisher)
{
$sel="select * from book where publisher_name='".$publisher."'";
$query=mysql_query($sel);
while($row=mysql_fetch_array($query))
{
?>
<table bgcolor="lightgreen" border="3">
<tr><td>Book title</td><td><?php echo $row['title']; ?></td></tr>
<tr><td>Publisher Name</td><td><?php echo $row['publisher_name']; ?></td></tr>
<tr><td>Publisher date</td><td><?php echo $row['publisher_date']; ?></td></tr>
<tr><td>Publisher Address</td><td><?php echo $row['publisher_address']; ?></td></tr>
<tr><td>No Of Copies</td><td><?php echo $row['no_of_copy']; ?></td></tr>
<tr><td>ISBN</td><td><?php echo $row['isbn']; ?></td></tr>
</table>
<?php echo $row['title']; ?>
<?php
}
}
else
{
echo "Please enter valid input";
}
?>
<div id="footer">
<div>
<p> </p>
<div id="connect"></div>
<div class="section">
<p>© Copyright Online Library - All Rights Reserved.</p>
</div>
</div>
</div>
</div>
</body>
</html>