Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6657815
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:49:01+00:00 2026-05-26T01:49:01+00:00

I recently upgraded my PHP version on my host and I think it is

  • 0

I recently upgraded my PHP version on my host and I think it is causing this error. Whenever I start apache and this include file is called to access the database, apache starts generating GIGABYTES of errors. I view the log and I receive this error

PHP Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in /var/www/html/includes/database.config.php on line 22

Line 22 is

while(($c = mysql_fetch_assoc($rsetCoupons)) !== false)

I am guessing that it will generate that error on every place this is listed.

Does anyone have any idea on what could be causing this? The current PHP version is

PHP 5.3.2 (cli) (built: Jun 25 2011 08:12:19)

Copyright (c) 1997-2010 The PHP Group

Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies

(obviously I cut out the variables for the connect at the beginning of the code)

@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;
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T01:49:02+00:00Added an answer on May 26, 2026 at 1:49 am

    $rsetCoupons is not a mysql query resource at that point in execution. Either your query is failing, or the variable is being lost somewhere.

    http://php.net/mysql_fetch_assoc

    I’m fairly certain you’re query is failing. You should check the return of mysql_query and if it’s false, then check mysql_error().

    Also, you should not suppress errors in your mysql_connect and mysql_select_db calls. If the database connection cannot be made, you should handle that more gracefully than letting your page trod on and error on every subsequent mysql call. That may actually be what your error is. If you’re suppressing errors to hide them from users, public facing PHP sites should have display_errors set to off, but you should still be logging errors.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We recently upgraded our PHP and apache versions on our server. Prior to this
I recently upgraded to PHP 5.3 and since then I get (sporadic) error messages
Our dev server was recently upgraded to PHP v5.2.13. With that upgrade we have
I am using PHP 5.3 on Ubuntu 10.0.4. I recently upgraded from PHP 5.2
I recently upgraded to Flash Builder 4.5 for PHP and am trying to upload
I recently upgraded to CodeIgniter 2.1. The below model code (machforms_model.php) was properly working
I recently upgraded a Joomla installation to 1.7. Due to this the linking system
I recently upgraded to IntelliJ 11 and the version 10 debugger used to allow
Pair.net recently upgraded our PHP install and afterwards client started see HTML in email
My server admin recently upgraded to PHP 5.3 and I'm getting a weird bug

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.