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