在解决另一个问题后,我现在在我的错误日志中得到了这个。我查看了 stackoverflow 上的所有内容,我想出的只是让它显示错误,问题是我找不到错误显示的位置,所以我无法以这种方式对其进行故障排除。任何人都可以帮助给我一些指导吗?我不想重复,我真的只是想了解发生了什么,如果放错了地方,对不起(如果是,请告诉我!)。
这是错误:
[Wed Mar 27 01:36:41 2013] [error] PHP Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /nas/wp/www/cluster-1434/XXXXXXX/wp-content/themes/mytheme/functions.php on line 574
[Wed Mar 27 01:36:14 2013] [error] PHP Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /nas/wp/www/staging/XXXXXXX/wp-content/themes/mytheme/functions.php on line 572
这是第 572 行:
$ll = mysql_fetch_array($getLL);
这是第 574 行:
$cou = mysql_fetch_array($getCount);
这是代码:
<?php
$con = conDB();
$x = 0;
//if ( false === ( $zip = get_transient( 'distinct_zips' ) ) ) {
$getZips = mysql_query("SELECT Distinct(meta_value) FROM wp_postmeta WHERE meta_key='_gmap_zip'",$con);
//$zip = mysql_fetch_array($getZips);
// set_transient('distinct_zips', $zip, 60*5);
//}
while($zip = mysql_fetch_array($getZips)){
$getLL = mysql_query("SELECT * FROM zipcodes WHERE zip=".$zip['meta_value'],$con);
$ll = mysql_fetch_array($getLL);
$getCount = mysql_query("SELECT Count(*) FROM wp_postmeta WHERE meta_key='_gmap_zip' AND meta_value=".$zip['meta_value'],$con);
$cou = mysql_fetch_array($getCount);
$zipvalue = $zip['meta_value'];
$getNewest = mysql_query('SELECT * FROM wp_postmeta WHERE meta_key="_gmap_zip" AND meta_value="'.$zipvalue.'" LIMIT 5',$con);
if(strlen($ll['lat'])){
?>
提前感谢您的所有帮助!