<?php
$link=mysql_connect('localhost','root','root') or die("ݿʧError:".mysql_errno().":".mysql_error());
//򿪷ǳ־õ MySQL ӡ

mysql_set_charset('gbk');
mysql_select_db('tushuguan') or die("ָݿʧ");
?>
//mysql_errno()һ MySQL еĴϢֱ롣mysql_error()һ MySQL ıϢ

<div class="a2">
<table width="777" height="290" border="1"> 
<th></th>
<th>ͼ</th>
<th>ͼ</th>
<th></th>
<th></th>
<th></th>
<th></th>
<?php
$sql="select * from book";
$res=mysql_query($sql);
if($res&&mysql_num_rows($res))
{
	while ($row = mysql_fetch_assoc($res)) 
	{
		echo "<tr>";
		echo "<td>".$row['bid']."</td>";
		echo "<td>".$row['bname']."</td>";
        echo "<td>".$row['btype']."</td>";
		echo "<td>".$row['chubanshe']."</td>";
		echo "<td>".$row['shujia']."</td>";
		echo "<td>".$row['shuliang']."</td>";
?>
<td>
<a href="index2?aa=&id=<?php echo 
$row['bid']?>&shuliang=<?php echo 
$row['shuliang']?>"></a>
</td>
<?php
		echo "</tr>";
	}
}
?>
</table>
</div>



<?php
include("./admin1/mycon.php");
function alertMes($mes,$url)
{
	echo "<script>alert('{$mes}');</script>";
	echo "<script>window.location='{$url}';</script>";
}
?>


mysql_query()  SELECTSHOWEXPLAIN  DESCRIBE ䷵һԴʶѯִвȷ򷵻 FALSE
͵ SQL 䣬mysql_query() ִгɹʱ TRUEʱ FALSE
 FALSE ķֵζŲѯǺϷĲִܹСⲢ˵κйӰ쵽Ļ򷵻صпһѯִгɹ˵δӰ쵽δκС
