01.
<html>
02.
<head><title>Add Book</title></head>
03.
<body>
04.
<?php
05.
echo
"<center>"
;
06.
echo
"<form action=\"addbook.php\" method=\"POST\">"
;
07.
echo
"<p>Book Id <input type=\"text\" name=\"bid\" size=\"30\"></p>"
;
08.
echo
"<p>Title <input type=\"text\" name=\"title\" size=\"30\"></p>"
;
09.
10.
11.
require
(
'conn_mysql.php'
);
12.
$sql
=
"select*from author"
;
13.
$result
=mysql_query(
$query
)
or
die
(
"Query failed"
);
14.
echo
"<p/>Author <select name=\"aid\">"
;
15.
while
(
$row
=mysql_fetch_array(
$result
)){
16.
echo
"<option value=\""
.
$row
[
"aid"
].
"\">"
.
$row
[
"firstname"
].
"  "
.
$row
[
"lastname"
].
"</option>"
;
17.
}
18.
echo
"</select>"
;
19.
20.
$sql1
=
"select*from language"
;
21.
$result1
=mysql_query(
$sql1
,
$conn
)
or
die
(
"Query failed"
);
22.
echo
"<p/>Language <select name=\"langcode\">"
;
23.
while
(
$row
=mysql_fetch_array(
$result1
)){
24.
echo
"<option value=\""
.
$row
[
"langcode"
].
"\">"
.
$row
[
"langname"
].
"</option>"
;
25.
}
26.
echo
"</select>"
;
27.
28.
$sql2
=
"select*from publisher"
;
29.
$result2
=mysql_query(
$sql2
,
$conn
)
or
die
(
"Query failed"
);
30.
echo
"<p/>Publisher <select name=\"pid\">"
;
31.
while
(
$row
=mysql_fetch_array(
$result2
)){
32.
echo
"<option value=\""
.
$row
[
"pid"
].
"\">"
.
$row
[
"name"
].
"</option>"
;
33.
}
34.
echo
"</select>"
;
35.
36.
echo
"<p><input type=\"submit\" name=\"submit\" value=\"SUBMIT\">"
;
37.
echo
"<input type=\"reset\" name=\"cancel\" value=\"RESET\"><p>"
;
38.
echo
"</form>"
;
39.
mysql_close(
$conn
);
40.
?>
41.
</body>
42.
</html>