Home > Backend Development > PHP Tutorial > Library management system database library management program (3)

Library management system database library management program (3)

WBOY
Release: 2016-07-29 08:33:33
Original
1542 people have browsed it

Book query part:
if(!$UploadAction):
?>
//This program is designed to output book title, author, and publisher information.
//Editor: Kong Xiuxiang. Date: 2001/3/25
?>

Bibliographic Query


ACTION= "" METHOD = "POST">






Title of work< INPUT NAME = "b_name" TYPE = "text" VALUE="" SIZE = "30" maxlength=100>
Author
First name
Publisher
Publication DateYear

ISBN







else:
session_start();
require "config.php3";
$b_price=$b_price_a.".".$b_price_b;
$UploadAction=0;
$repeat=0; //Is this a duplicate?
$TimeLimit=0; //Set the timeout limit. The default time is 30 seconds. When set to 0, there is no time limit.
set_time_limit($TimeLimit);
@MYSQL_CONNECT($hostname,$dbusername,$dbpassword) OR DIE("Cannot Connect to the database! ");
@mysql_select_db("$dbname") or die("Cannot select 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="There are no records that meet the requirements. ";
" =$count[2];
$last_name=$count[3];
$publisher_name=$count[4];
if($book!=$books_id){
$repeat++;
echo "
" .$repeat.""; last_name ";
$book=$books_id;
}
echo"
return";
echo"";
?>
endif;
?>

The above introduces the library management system database and library management program (3), including the content of the library management system database. I hope it will be helpful to friends who are interested in PHP tutorials.


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template