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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T20:18:04+00:00 2026-06-13T20:18:04+00:00

Possible Duplicate: mysql_fetch_array() expects parameter 1 to be resource, boolean given in select Okay,

  • 0

Possible Duplicate:
mysql_fetch_array() expects parameter 1 to be resource, boolean given in select

Okay, so I have my page “List Customers” which then links to “List Jobs” adding on ?custID= into the URL, then on List jobs I have used $_GET["custID"] so my query uses the custID from the URL. that works fine, lists out my jobs for said customer using their ID.

My problem comes up now, I need the links on this page to give my third page the techID as well. But the techID is in jobDetails, so my query cannot give them the techID as it is querying my job section.

This is my “ListJobs.php” page, which upon choosing a customer in the page before it, loads this page with the url ListJobs.php?custID=001 (001 being an example, it will give the number depending on your choice of customer).

<?php 
// Get data from the database depending on the value of the id in the URL
mysql_select_db($database_con_sim5, $con_sim5);
$query_Recordset1 = "SELECT * FROM job WHERE custID=" . $_GET["custID"] ;
$Rs1 = mysql_query($query_Recordset1);
// Loop the recordset $rs
while($row = mysql_fetch_array($Rs1)) {
  $strName1 = $row['jobID'] . " " . $row['jobDesc'] . " " . $row['computerName'];
  $strLink = "<a href = 'jobDetails.php?jobID=".$row['jobID']."'>".$strName1."</a>";
  // Write the data of the person
  echo "<li>" . $strLink . " </li>";
}
// Close the database connection
mysql_close();
?>

Then on pressing one of the links, link to jobDetails.php?jobID= with the job number.
I am able to show all the details in Job Detail with this, but I also need my Tech Name to appear, Tech Name is not in Job Details, but Tech ID is.
Here is my Job Details page coding :

<?php 
// Get data from the database depending on the value of the id in the URL
mysql_select_db($database_con_sim5, $con_sim5);
$query_Recordset1 = "SELECT * FROM jobDetail WHERE jobID=" . $_GET["jobID"] ;
$query_Recordset2 = "SELECT technician.techName FROM technician 
  WHERE techID=" . $query_Recordset1["techID"] ;
$Rs1 = mysql_query($query_Recordset1);
$Rs2 = mysql_query($query_Recordset2);
while($row1 = mysql_fetch_array($Rs1)) {
  while($row2 = mysql_fetch_array($Rs2)) {
    echo "<dt><strong>Job Note ID:</strong></dt><dd>".$row1["jobNoteID"]."</dd>";
    echo "<dt><strong>Job Notes:</strong></dt><dd>".$row1["jobNotes"]."</dd>";
    echo "<dt><strong>Date Completed:</strong></dt><dd>".$row1["dateCompleted"]."</dd>";
    echo "<dt><strong>Time Spent:</strong></dt><dd>".$row1["timeSpent"]."</dd>";
    echo "<dt><strong>Job ID:</strong></dt><dd>".$row1["jobID"]."</dd>";
    echo "<dt><strong>Technician ID:</strong></dt><dd>".$row1["techID"]."</dd>";
    echo "<dt><strong>Technician Name:</strong></dt><dd>".$row2["techName"]."</dd>";
  }
}
// Close the database connection
mysql_close();
?>

The error I am getting is:

Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in D:\xampp\htdocs\Sim5Server\Pages\jobDetails.php on line 129

That line is:

while($row2 = mysql_fetch_array($Rs2)) { 

I hope I am making any sense AT ALL.

To sum up, I need my final page to show data from mysql technician using the Primary/index key techID.
Some way to add techID onto either listJobs’ links to job details or in job details’ second Recordset.

EDIT:
I should probably state this will never be used on the net, I only need it to work for an assignment. in future, thanks to a comment, I will no longer be using mysql_* I am jsut using them as my entire workbook tells us to use it.

  • 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-06-13T20:18:05+00:00Added an answer on June 13, 2026 at 8:18 pm

    Try making this change in your jobDetails.php page

    $query_Recordset1 = "SELECT * FROM jobDetail WHERE jobID=". (int) $_GET["jobID"];
    $Rs1 = mysql_query($query_Recordset1) or die(mysql_error());
    while($row1 = mysql_fetch_array($Rs1)) {
      $query_Recordset2 = "SELECT technician.techName FROM technician 
      WHERE techID=" . $row1["techID"] ;
      $Rs2 = mysql_query($query_Recordset2) or die(mysql_error());
      while($row2 = mysql_fetch_array($Rs2)) {
    

    For the second query you were using the result resource from executing the first query as techID. Also you will have to query for techName from inside the while loop fetching job details, since only then will you have the techID.

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

Sidebar

Related Questions

Possible Duplicate: mysql_fetch_array() expects parameter 1 to be resource, boolean given in select This
Possible Duplicate: mysql_fetch_array() expects parameter 1 to be resource, boolean given in select I
Possible Duplicate: mysql_fetch_array() expects parameter 1 to be resource, boolean given in select When
Possible Duplicate: mysql_fetch_array() expects parameter 1 to be resource, boolean given in select Here's
Possible Duplicate: mysql_fetch_array() expects parameter 1 to be resource, boolean given in select i
Possible Duplicate: mysql_fetch_array() expects parameter 1 to be resource, boolean given in select I'm
Possible Duplicate: mysql_fetch_array() expects parameter 1 to be resource, boolean given in select I
Possible Duplicate: mysql_fetch_array() expects parameter 1 to be resource, boolean given in select when
Possible Duplicate: mysql_fetch_array() expects parameter 1 to be resource, boolean given in select I
Possible Duplicate: mysql_fetch_array() expects parameter 1 to be resource, boolean given in select I

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.