?? newbooks.php
字號:
<html><head><title>新書上架</title>
<meta content="text/html;charset=gb2312" http-equiv=Content-Type></head>
<?
require("index.html.inc");
?>
<?
function conndb()
{
$db=@mysql_pconnect("localhost","root","307910");
if($db==false)
{
print "Database failed!";
exit();
}
return $db;
}
function getrows($id,$class)
{
$num=@mysql_num_rows($id);
if($num==0)
{
print "<tr><td colspan=2>no new books!</td></tr>";
}
else
{
for($i=0;$i<$num;$i++)
{
$row=@mysql_fetch_row($id);
print "<tr><td><A href=\"detail.php?isbn=$row[0]\">$row[1]</A></td><td>$row[2]</td></tr>\n";
}
print "<tr><td colspan=2 align=right>";
print "<A href=\"newbooks2.php?class=$class\">";
print "<FONT color=#cc0066>更多...</FONT></a></td></tr>\n";
}
}
?>
<body>
<table width="100%" border=1 cellspacing=1 cellpadding=1 bgcolor=#8cc9ec>
<tbody>
<tr>
<td width="50%">
<table border=1 width="100%">
<tbody>
<tr>
<td align=center colspan=2><FONT class=font6>新進醫生</FONT>
</td>
</tr>
<?
$db=conndb();
$query="select isdn,title,author from books where ";
$query=$query."class>1000 and class<2000 ";
$query=$query."order by publishday limit 10;";
$res=@mysql_query("set names 'gb2312'");/////////////////////////////////////////////////
$res=@mysql_db_query("bookseller",$query,$db);
if($res==false)
{
print "連接表失敗!";
exit();
}
getrows($res,1000);
?>
</tbody></table>
<table border=1 width="100%">
<tbody>
<tr>
<td align=center colspan=2><FONT class=font6>新進器械</FONT>
</td>
</tr>
<?
$db=conndb();
$query="select isdn,title,author from books where ";
$query=$query."class>3000 and class<4000 ";
$query=$query."order by publishday limit 10;";
$res=@mysql_query("set names 'gb2312'");//////////////////////////////////////////////////
$res=@mysql_db_query("bookseller",$query,$db);
if($res==false)
{
print "連接表失敗!";
exit();
}
getrows($res,3000);
?>
</tbody></table>
<table border=1 width="100%">
<tbody>
<tr>
<td align=center colspan=2><FONT class=font6>新增床位</FONT>
</td>
</tr>
<?
$db=conndb();
$query="select isdn,title,author from books where ";
$query=$query."class>4000 and class<5000 ";
$query=$query."order by publishday limit 10;";
$res=@mysql_query("set names 'gb2312'");/////////////////////////////////////////////////////////////
$res=@mysql_db_query("bookseller",$query,$db);
if($res==false)
{
print "連接表失敗!";
exit();
}
getrows($res,4000);
?>
</tbody></table></td>
<td width="50%">
<table valign=top border=1 width="100%">
<tbody>
<tr>
<td align=center colspan=2><FONT class=font6>新進護士</FONT>
</td>
</tr>
<?
$db=conndb();
$query="select isdn,title,author from books where ";
$query=$query."class>2000 and class<3000 ";
$query=$query."order by publishday limit 10;";
$res=@mysql_query("set names 'gb2312'");/////////////////////////////////////////////////
$res=@mysql_db_query("bookseller",$query,$db);
if($res==false)
{
print "連接表失敗!";
exit();
}
getrows($res,2000);
?>
</tbody></table>
<table border=1 width="100%">
<tbody>
<tr>
<td align=center colspan=2><FONT class=font6>新進醫藥</FONT>
</td>
</tr>
<?
$db=conndb();
$query="select isdn,title,author from books where ";
$query=$query."class>5000 and class<6000 ";
$query=$query."order by publishday limit 10;";
$res=@mysql_query("set names 'gb2312'");/////////////////////////////////////////////////
$res=@mysql_db_query("bookseller",$query,$db);
if($res==false)
{
print "連接表失敗!";
exit();
}
getrows($res,5000);
?>
</tbody></table>
<table border=1 width="100%">
<tbody>
<tr>
<td align=center colspan=2><FONT class=font6>新設領導</FONT>
</td>
</tr>
<?
$db=conndb();
$query="select isdn,title,author from books where ";
$query=$query."class>6000 and class<7000 ";
$query=$query."order by publishday limit 10;";
$res=@mysql_query("set names 'gb2312'");/////////////////////////////////////////////////////
$res=@mysql_db_query("bookseller",$query,$db);
if($res==false)
{
print "連接表失敗!";
exit();
}
getrows($res,6000);
?>
</tbody></table>
</td></tr>
</tbody></table>
</body>
<?
require("foot.html.inc");
?>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -