我最近把我的购买力平价版本升级到我的东道国,我认为这造成了这一错误。 每当我开始点火时,这包括要求档案进入数据库,便开始产生GIGABYTES的错误。 我看到该日志,我收到这一错误。
PHP 警告:mysql_fetch_assoc()预计参数1为资源,Boolean given in /var/www/html/includes/database.config.php on line 22
第22条
while(($c = mysql_fetch_assoc($rsetCoupons)) !== false)
我猜测,它将在列出的每一个地方产生这一错误。
是否有任何人认为可以造成这种情况? 现行购买力平价版本。
P 5.3.2 (cli) (built: Jun 25 2011 08:12:19)
Copyright (c) 1997-2010年PHP Group
Zend Trust v2.3.0, 版权(c) 1998-2010 Zend Technologies
(显然,我删除了代码一开始连接的变量)
@mysql_connect(MYSQL_HOST, MYSQL_USERNAME, MYSQL_PASSWORD);
@mysql_select_db(MYSQL_DATABASE);
define( DOMAIN , MYDOMAINISTHIS.com );
$parse_version = queryFetch( SELECT version,secret FROM version ORDER BY version_id DESC LIMIT 0,1 );
$VERSION = $parse_version[ version ];
$SECRET = $parse_version[ secret ];
$VALID_COUPONS = array();
$rsetCoupons = query( SELECT * FROM coupons ORDER BY coupon_id ASC );
while(($c = mysql_fetch_assoc($rsetCoupons)) !== false)
{
$VALID_COUPONS[$c[ code ]] = $c[ percent ];
}
$salutations = array();
$rsetSalutations = query( SELECT * FROM salutations ORDER BY salutation_id ASC );
while(($c = mysql_fetch_assoc($rsetSalutations)) !== false)
{
$salutations[] = $c[ salutation ];
}
$BASE_PRICE_QTY = array();
$UPGRADE_PRICE = array();
$rsetPrices = query( SELECT * FROM cart_prices ORDER BY qty ASC );
while(($c = mysql_fetch_assoc($rsetPrices)) !== false)
{
$BASE_PRICE_QTY[] = $c[ unit_price ];
$UPGRADE_PRICE[] = $c[ upgrade_price ];
}
function insert($hash, $table)
{
$fields = implode( , , array_keys($hash));
$values = implode( "," , $hash);
$query = sprintf( INSERT INTO %s (%s) VALUES("%s") , $table, $fields, $values);
query($query);
}
function query($query)
{
return @mysql_query($query);
}
function queryFetch($query)
{
return @mysql_fetch_assoc(query($query));
}
function p($key, $default = )
{
if (isset($_POST[$key]))
{
return $_POST[$key];
}
else
{
return $default;
}
}
function g($key, $default = )
{
if (isset($_GET[$key]))
{
return $_GET[$key];
}
else
{
return $default;
}
}