Library management procedure (III)

Source: Internet
Author: User
Book management procedure (3) book query section:
If (! $ UploadAction ):
?>
// This program is used to output the title, author, and publisher information.
// Editor: Kong Xiuxiang. Date: 2001/3/25
?>

Bibliography query







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
";
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"
". $ Repeat .",";
Echo ". $ books_name." ";
Echo "Press:". $ count [4];
Echo "author :";
}
Echo "$ first_name $ last_name ";
$ Book = $ books_id;
}

Echo"
Return ";
Echo"";

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