圖書查詢部分:
if(!$UploadAction):
?>
//本程式是為輸出書名,作者、出版社資料而設。
//編者:孔秀祥。日期:2001/3/25
?>
書目查詢
else:
session_start();
require "config.php3";
$ b_price=$b_price_a.".".$b_price_b;
$UploadAction=0;
$repeat=0; //是不是重複了。
$TimeLimit=0; //設定超時限制時間觸發時間為30秒設定為0時為不限時
set_time_limit($TimeLimit);
@MYSQL_CONNECT($hostname,$dbusername,$dbpassword) OR DIE("不能連接資料庫!");
@mysql_select_db("$dbname") or die("不能選擇資料庫!");
//$q="從books,author,books_author,publisher中選擇books.books_id, books.books_name,author.first_name,author.last_name,publisher.publisher_name 其中books.books_name="$b_name" 和books.publisher_id =publisher.publisher_id 和books.books_horbooks_book 和books. =author.author_id";
if($b_name!="")
$bn="books.books_name="$b_name" 和";
if($p_name!="")
$pn="publisher.publisher_name="$p_name" 和";
if($a_first1!="")
$af="author.first_name="$a_first1" 和";
if ($a_last1!="")
$al="author.last_name="$a_last1" 和";
if($p_year!=""){
$date_p="books.date_pubrlikes.date_pubrlikes. '^$p_year.*' 且";
}
if($isbn!="")
$is="books.ISBN="$isbn" 和";
$q= "select books.books_id, books.books_name,author.first_name,author.last_name,publisher.publisher_name from books,author,books_author,publisher
其中$bn $pn $afal $date_psher 是.publisher_id 和books.books_id=books_author.books_id 和books_author.author_id=author.author_id 按books.books_name 排序」;
$r = @mysql_query($q);
if(!$ > echo "查詢無效
";
退出;
}
if(mysql_num_rows($r) $msg="沒有符合要求的記錄。 ";
xueroom_error_exit($msg,$PHP_SELF);
}
while($count=mysql_fetch_array($r)){ $first_name=$count[2];
$last_name=$count[3];
!=$books_id){
$repeat++;
,echo "
".$repeat."、"; 《5p. echo "出版社:".$count[4];
echo " 作者:";
}
> echo"
返回";
echo"