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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T14:09:39+00:00 2026-05-14T14:09:39+00:00

Possible Duplicate: “Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given” error while

  • 0

Possible Duplicate:
“Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given” error while trying to create a php shopping cart

I don’t get it, I see no mistakes in this code but there is this error, please help:
mysql_fetch_array() expects parameter 1 to be resource problem

<?php

      $con = mysql_connect("localhost","root","nitoryolai123$%^");
    if (!$con)
      {
      die('Could not connect: ' . mysql_error());
      }

    mysql_select_db("school", $con);
       $result = mysql_query("SELECT * FROM student WHERE IDNO=".$_GET['id']);
    ?>     


                           <?php while ($row = mysql_fetch_array($result)) { ?>             
                                     <table class="a"  border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#D3D3D3">
    <tr>

    <form name="formcheck" method="get" action="updateact.php" onsubmit="return formCheck(this);">
    <td>
    <table  border="0" cellpadding="3" cellspacing="1" bgcolor="">
    <tr>

    <td  colspan="16" height="25"  style="background:#5C915C; color:white; border:white 1px solid; text-align: left"><strong><font size="2">Update Students</td>


    <tr>
    <td width="30" height="35"><font size="2">*I D Number:</td>
    <td width="30"><input  name="idnum" onkeypress="return isNumberKey(event)" type="text" maxlength="5" id='numbers'/ value="<?php echo $_GET['id']; ?>"></td>
    </tr>

    <tr>
    <td width="30" height="35"><font size="2">*Year:</td>
    <td width="30"><input  name="yr" onkeypress="return isNumberKey(event)" type="text" maxlength="5" id='numbers'/ value="<?php echo $row["YEAR"]; ?>"></td>

<?php } ?>

I’m just trying to load the data in the forms but I don’t know why that error appears. What could possibly be the mistake in here?

  • 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-14T14:09:39+00:00Added an answer on May 14, 2026 at 2:09 pm

    You are not doing error checking after the call to mysql_query:

    $result = mysql_query("SELECT * FROM student WHERE IDNO=".$_GET['id']);
    if (!$result) { // add this check.
        die('Invalid query: ' . mysql_error());
    }
    

    In case mysql_query fails, it returns false, a boolean value. When you pass this to mysql_fetch_array function (which expects a mysql result object) we get this error.

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

Sidebar

Ask A Question

Stats

  • Questions 512k
  • Answers 512k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I don't know what you are doing... but I am… May 16, 2026 at 5:36 pm
  • Editorial Team
    Editorial Team added an answer Go to Project->Properties->Linker->Command Line and check the value of /OUT:… May 16, 2026 at 5:36 pm
  • Editorial Team
    Editorial Team added an answer You can do that, as long as the box sending… May 16, 2026 at 5:36 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

Possible Duplicate: g++ “is not a type” error The following does not compile: 1
Possible Duplicate: Weird “406 not acceptable” error following code generate a 406 Not Acceptable
Possible Duplicate: how to disable javascript errors on “twebbrowser” ? I'm using the TWebBrowser
Possible Duplicate: “using” keyword in java I'm transitioning from C# to java, so please
Possible Duplicate: “BigInt” in C? Hey there! I'm calculating the Fibonacci numbers in C
Possible Duplicate: Are “(function ( ) { } ) ( )” and “(function (
Possible Duplicate: Python “extend” for a dictionary I know that Python list can be
Possible Duplicate: is “else if” faster than “switch() case” ? I've encountered a lot
Possible Duplicate: DateTime “null” value is it possible to set datetime object to null?
Possible Duplicate: ASP.NET “special” tags I hope this isn't too much of a newbie

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.