Library Management Procedure (III)

Source: Internet
Author: User

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;
?>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.