Book query section:
<?
If (! $ Uploadaction ):
?>
<?
// Book Program It is used to output the title, author, and Publisher Information.
// Editor: Kong xiuxiang. Date: 2001/3/25
?>
<HTML> <Title> bibliography query </title>
</Head>
<Body> <Table align = center>
<Form enctype = "multipart/form-Data" name = "submitform"
Action = "<? $ Php_self?> "Method =" Post ">
<Input type = "hidden" name = "max_file_size" value = "20000000">
<Input type = "hidden" name = "uploadaction" value = "1">
file name
book name
author last name
name
press
publication date year
month <-->
ISBN
</Table> <Table align = center>
<Tr> <TD align = center>
<Input name = "Submit" value = "Submit" type = "Submit">
<TD> <input name = "reset" value = "reset" type = "reset">
</TD> </tr>
</Form> </center> </table> </body>
</Html>
<?
Else:
Session_start ();
Require "config. php3 ";
$ B _price = $ B _price_a. ".". $ B _price_ B;
$ Uploadaction = 0;
$ Repeat = 0; // is the repeat repeated.
$ Timelimit = 0; // set the time-out period. The default time is 30 seconds. If it is set to 0, the time-out period is not limited.
Set_time_limit ($ timelimit );
@ Mysql_connect ($ hostname, $ dbusername, $ dbpassword) or die ("cannot connect to the database! ");
@ Mysql_select_db ("$ dbname") or die ("You cannot select a database! ");
// $ Q = "select books. books_id, books. books_name, author. first_name, author. last_name, publisher. publisher_name from books, author, books_author, publisher where books. books_name = "$ B _name" and books. publisher_id = publisher. publisher_id and books. books_id = books_author.books_id and books_author.author_id = author. author_id ";
If ($ B _name! = "")
$ Bn = "books. books_name =" $ B _name "and ";
If ($ p_name! = "")
$ Pn = "publisher. publisher_name =" $ p_name "and ";
If ($ a_first1! = "")
$ AF = "author. first_name =" $ a_first1 "and ";
If ($ a_last1! = "")
$ Al = "author. last_name =" $ a_last1 "and ";
If ($ p_year! = ""){
$ Date_p = "books. date_pub rlike '^ $ p_year. *' and ";
}
If ($ ISBN! = "")
$ Is = "books. ISBN =" $ ISBN "and ";
$ Q = "select books. books_id, Books. books_name, author. first_name, author. last_name, publisher. publisher_name from books, author, books_author, publisher
Where $ bn $ PN $ af $ Al $ date_p $ is books. publisher_id = publisher. publisher_id and books. books_id = books_author.books_id and books_author.author_id = author. author_id order by books. books_name ";
$ R = @ mysql_query ($ q );
If (! $ R ){
Echo "invalid query <br> ";
Exit;
}
If (mysql_num_rows ($ R) <1 ){
$ MSG = "no matching record. ";
Xueroom_error_exit ($ MSG, $ php_self );
}
While ($ COUNT = mysql_fetch_array ($ R )){
$ Books_id = $ count [0];
$ Books_name = $ count [1];
$ First_name = $ count [2];
$ Last_name = $ count [3];
$ Publisher_name = $ count [4];
If ($ book! = $ Books_id ){
$ Repeat ++;
Echo "<br>". $ repeat .",";
Echo ". $ books_name." ";
Echo "Press:". $ count [4];
Echo "Author :";
}
Echo "$ first_name $ last_name ";
$ Book = $ books_id;
}
Echo "<br> <a href = $ php_self> return </a> ";
Echo "</body>
?>
<?
Endif;
?>