为什么mysql_close()语句总是报is not a valid MySQL-Link resource ?
出错语句:
Warning: mysql_close(): 1 is not a valid MySQL-Link resource in xxx.php on line 259
代码如下:
$db_conn=mysql_connect($hostname,$username,$password);
mysql_select_db($dbname,$db_conn);
$strSql="select * from table where ProductName like '%$SearchProductName%' or Keyword like '%$SearchProductName%'";
$result=mysql_query($strSql,$db_conn);
$TotalResultRows = mysql_num_rows($result);
if($CurrentPageNum > ((int)($TotalResultRows /10)+1))
$CurrentPageNum = ((int)($TotalResultRows /10)+1);
$strSql="select * from software_table where ProductName ='$SearchProductName' or Keyword like '%$SearchProductName%' ORDER BY SortRating DESC,Rating DESC,UpgardeDate DESC LIMIT ".(($CurrPageNum-1)*10).",".(($CurrPageNum)*10);
$result=mysql_query($strSql,$db_conn);
while($row=mysql_fetch_array($result))
{
...
}
mysql_close($db_conn);// 出错语句
其中...表示HTML中显示输出.