錯誤代碼如下
aabb
Warning: mysql_connect() [function.mysql-connect]: [2002] 由於目標機器積極拒絕,無法連接。 (trying to connect via tcp://localhost:3306) in X:test7.php on line 6
Warning: mysql_connect() [function.mysql-connect]: 由於目標機器積極拒絕,無法連接。 in X:test7.php on line 6
Warning: mysql_select_db() [function.mysql-select-db]: [2002] 由於目標機器積極拒絕,無法連接。 (trying to connect via tcp://localhost:3306) in X:test7.php on line 7
Warning: mysql_select_db() [function.mysql-select-db]: 由於目標機器積極拒絕,無法連接。 in X:test7.php on line 7
Warning: mysql_select_db() [function.mysql-select-db]: A link to the server could not be established in X:test7.php on line 7
Warning: mysql_query() [function.mysql-query]: [2002] 由於目標機器積極拒絕,無法連接。 (trying to connect via tcp://localhost:3306) in X:test7.php on line 8
Warning: mysql_query() [function.mysql-query]: 由於目標機器積極拒絕,無法連接。 in X:test7.php on line 8
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in X:test7.php on line 8
Warning: mysql_query() [function.mysql-query]: [2002] 由於目標機器積極拒絕,無法連接。 (trying to connect via tcp://localhost:3306) in X:test7.php on line 14
Warning: mysql_query() [function.mysql-query]: 由於目標機器積極拒絕,無法連接。 in X:test7.php on line 14
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in X:test7.php on line 14
Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in X:test7.php on line 15
Array ( )
程序代碼很簡單
代碼如下 復制代碼
$sql = "Select * from v_xyp where systype=5 ";
$array = array();
$rq = mysql_query( $sql );
if( mysql_num_rows( $rq ) )
{
while( $rs = mysql_fetch_array( $rq ) )
{
//$sql ="update v_xyp set b_body= '".str_replace("'",'',strip_tags(stripslashes($rs['U_love'])))."' where id=".$rs['id'];
//mysql_query( $sql ) ;//or die(mysql_error());
//echo $rs['id'].'<br />';
$sqlb ="select * from v_xyp where systype=5 and b_body='".str_replace("'",'',strip_tags(stripslashes($rs['U_love'])))."' and id<>".$rs['id'];
$query = mysql_query( $sqlb ) ;//or die(mysql_error());
$num = mysql_num_rows( $query );
if( $num )
{
echo '<font color="#0000FF">{'.$rs['title'].'}重復內容有{'.$num.'}條</font><br />';
while( $rs1 = mysql_fetch_array( $query ) )
{
echo $rs1['title'].'<br />';
}
echo '<hr />';
}/**/
}
//echo '標題:<font color=red>'.$title.'</font>己處理過,自動跳過!';
}
解決辦法。
想來想去都沒想到,後來在服務中看mysql狀態結果自動掛了,mysql自動停了哦,這個可能與我數據處理量或算法有問題了,重啟mysql就解決了。