国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 開(kāi)發(fā) > PHP > 正文

圖書(shū)管理程序(三)

2024-05-04 23:01:21
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友
圖書(shū)查詢部分:
<?
if(!$uploadaction):
?>
<?
//本程序是為輸出書(shū)名,作者、出版社資料而設(shè)。
//編者:孔秀祥。日期:2001/3/25
?>
<html><head>
<title>書(shū)目查詢 </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">

<!--tr><td>文件名<td><input name = "uploadfile" type = "file" value="" size = "30"></tr-->
<tr><td align=center>著作名<td><input name = "b_name" type = "text" value="" size = "30" maxlength=100></td></tr>
<tr><td align=center>作者<td>姓<input name = "a_first1" type = "text" value="" size = "6" maxlength=20>
名<input name = "a_last1" type = "text" value="" size = "6" maxlength=20></td></tr>
<tr><td align=center>出版社<td><input name = "p_name" type = "text" value="" size = "30" maxlength=100></td></tr>
<tr><td>出版日期<td><input name = "p_year" type = "text" value="" size = "4">年
<!--input name = "p_month" type = "text" value="" size = "2">月 <-->
<tr><td>isbn<td><input name = "isbn" type = "text" value="" size = "25">

</table><table align=center>
<tr><td align=center>
<input name = "submit" value = "提交" type = "submit">
<td><input name = "reset" value = "重置" 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;      //是不是重復(fù)了。
$timelimit=0; //設(shè)置超時(shí)限制時(shí)間缺省時(shí)間為 30秒設(shè)置為0時(shí)為不限時(shí)
set_time_limit($timelimit);
@mysql_connect($hostname,$dbusername,$dbpassword) or die("不能連接數(shù)據(jù)庫(kù)!");
@mysql_select_db("$dbname") or die("不能選擇數(shù)據(jù)庫(kù)!");
//$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 "查詢無(wú)效 <br>";
    exit;
}
if(mysql_num_rows($r)<1){
    $msg="沒(méi)有符合要求的記錄。";
    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 "出版社:".$count[4];
        echo "&nbsp;&nbsp;作者:";
    }
    echo "$first_name$last_name ";
    $book=$books_id;
}

echo"<br><a href = $php_self>返回 </a>";
echo"</body></html>";

?>
<?
endif;
?>


發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 江安县| 永定县| 米易县| 小金县| 应城市| 尚义县| 内江市| 合水县| 江阴市| 临汾市| 十堰市| 资兴市| 云阳县| 米泉市| 仙居县| 蛟河市| 锡林郭勒盟| 洪江市| 启东市| 叶城县| 黄石市| 旬邑县| 台前县| 棋牌| 九寨沟县| 涟源市| 简阳市| 福鼎市| 大港区| 渭南市| 湘潭县| 屏山县| 东海县| 富蕴县| 正镶白旗| 隆回县| 恩平市| 泸西县| 安岳县| 云浮市| 溧水县|