⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 newbooks.php

📁 网上书店网站系统
💻 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 + -