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

  • Home
  • SEARCH
  • 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 3439434
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T08:18:36+00:00 2026-05-18T08:18:36+00:00

I have a database with a table which includes among others, one column of

  • 0

I have a database with a table which includes among others, one column of dates (the column is titled ‘date’) in the format of Y-m-d.

I want to extract all the rows of data which have been logged during the current month, so I am using the following query:

$year_month = date("Y-m");
$query = "SELECT date FROM tracker WHERE date LIKE '$year_month%'";

When I execute the query and attempt to output it visually, I get the error “Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource on line 64”.

Line 64 is the beginning of the following loop:

while($row = mysql_fetch_array($result, MYSQL_ASSOC)
{
    echo "Name :{$row['date']} <br>";
}

I’ve scoured google and had a look here too, but I can’t seem to figure out this seemingly simple problem. As far as I can tell, the actual query is executing just fine.

Any ideas?

** Additional – Call to MySQL Query Below **

$result = mysqli_query($conn, $query);

$conn refers to the following line:

$conn = @mysqli_connect($dbhost, $dbuser, $dbpass, $dbname) or die ('Error connecting to MySQL');
  • 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-18T08:18:36+00:00Added an answer on May 18, 2026 at 8:18 am

    Two things jump out at me:

    1. Are you sure that’s the query that goes with that result? Queries like insert and delete do not have results. They return a boolean indicating success.

    2. Are you checking to make sure the query succeeded? After the line where you call mysql_query, make sure you check the result. If it’s false, you can call mysql_get_error to find out what went wrong.

    EDIT: Okay, your real problem is that you’re mixing mysql_* and mysqli_* commands. You need to use one or the other.

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

Sidebar

Related Questions

I have a Rails model called Person which has database table columns for first_name
I have an abstract class for moving data from one database to another, and
I have a table in SQL Server 2008 R2 consisting of about 400 rows
Technology: Hibernate 3.0 Suppose i have Entity class Company @Entity @Table(name=tbl_companies) public class Company
I have a asp.net-mvc website with a SQL server backend (using nhibernate for OR
My Database contains three tables: PermissionCategories, Permissions, and Users. There is a many to
My application loads lots of data from a database into a complex data structure.
Please note, this question is regarding the shipping cost, not price. There is an
I'm using the latest NMG version 2.0 RC1 to generate Fluent mappings for an

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.