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 7580865
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T18:01:33+00:00 2026-05-30T18:01:33+00:00

Ok then guys, this is embarassing. I am getting this PHP error, already linted,

  • 0

Ok then guys, this is embarassing. I am getting this PHP error, already linted, checked code and don’t get the answer. Any suggestion?

**Warning**: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in file.php on line **, heres the complete code

<?
session_start();

include 'keys.php';

include 'EpiCurl.php';
include 'EpiOAuth.php';
include 'EpiTwitter.php';
?>

As additional data, it pushes data correctly to databases but interrupts the following part of the code.

UPDATE: The problem was in the “require” files, not in the code I posted, I was using this code: while($results = mysql_fetch_array($results)) { in where I repeated 2 $results

  • 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-30T18:01:34+00:00Added an answer on May 30, 2026 at 6:01 pm

    You’re assuming that mysql_query() with a SELECT statement always returns a resultset resource. This is not the case. Quote from mysql_query() documentation:

    For SELECT, SHOW, DESCRIBE, EXPLAIN and other statements returning
    resultset, mysql_query() returns a resource on success, or FALSE on
    error.

    For other type of SQL statements, INSERT, UPDATE, DELETE, DROP, etc,
    mysql_query() returns TRUE on success or FALSE on error.

    Thus, in case of error you end up passing a boolean FALSE value to mysql_fetch_array() instead of a resultset. This is why one should check whether the value returned by mysql_query() is FALSE before passing it to other functions as a resultset.

    UPDATE: Apparently the code we were shown was different from the one actually causing the problem. The problem was caused by passing a return value from mysql_fetch_array() back to it on a second call:

    while($results = mysql_fetch_array($results))
    

    Either way, passing a value which isn’t a resultset to mysql_fetch_array() was the cause of the issue exactly as the error message said:

    Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in file.php on line

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

Sidebar

Related Questions

Hi guys I'm using this code http://www.w3schools.com/php/php_file_upload.asp to upload files and it works great
Every now and then I get an error when I set up states in
A small problem. Any idea guys why this does not work? int? nullableIntVal =
Hey guys this is a snippet of my current code. I want to know
Consider this code: datestring = date.min.strftime(%d-%m-%Y) date = datetime.strptime(datestring,%d-%m-%Y) This raises the following error:
Hey guys please check this page . Please visit the page using any browser
Great guys have helped me a lot in this other post: Get last word
Hey guys, This is my first time making an app with any kind of
Hi guys i have this line of code in a perl script where i
Guys check this out : http://www.codetoad.com/html/buttons/image_submit_button.asp You'll notice then when you click the button

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.