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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T14:24:30+00:00 2026-06-06T14:24:30+00:00

The warning I’m getting is: Warning: mysqli_result::fetch_array() expects parameter 1 to be long, object

  • 0

The warning I’m getting is:

Warning: mysqli_result::fetch_array() expects parameter 1 to be long, object given in…line 103.

I’ve commented next to the line 103 while ($row = $result->fetch_array($result)) {

Question 2: Can I store any of this in an include file or should I?

Question 3: For the $query can I store any of these Buyer, Seller, etc. in an array somewhere? How?

/* FETCH CONTACT INFORMATION */

$query = ("SELECT * FROM contacts WHERE contacttype IN ('Buyer','Seller','Buyer / Seller','Investor') AND leadstatus = 'New' ORDER BY date DESC");

$ID = $row ['ID'];     
$firstname = $row ['firstname'];     
$lastname = $row['lastname'];
$ID = $row['ID'];   
$partner  = $row['spousefirst'];   
$phonecell = $row['phonecell'];
$email = $row['email'];
$date = $row['date'];
$contacttype = $row['contacttype'];
$agentassigned = $row['agentassigned'];
$leadstatus = $row['leadstatus'];

$result = $mysqli->query($query) or die ("Error: ".mysqli_error($mysqli));

echo'
  <table class="results" id="results">
    <thead> 
      <tr> 
        <th width="10"><input type="checkbox" name="checkAll" id="checkAll" class="checkall" value="check all"></th>
        <th>NAME</td> 
        <th>PARTNER</td> 
        <th>PHONE</td> 
        <th>EMAIL</td> 
        <th>DATE</td> 
        <th>TYPE</td> 
        <th>AGENT</td> 
        <th>STATUS</td> 
        <th>NOTES</td> 
        <th>TASKS</td> 
        <th>&nbsp;</td>
       </tr> 
     </thead>';

while ($row = $result->fetch_array($result)) {  // THIS IS LINE 103

      echo'
     <tbody>       
       <tr>
        <td width="10"><input type="checkbox" name="" id="" value="'.$ID.'"></td>
        <td><a href="/backend/leads/view/?ID='.$ID.'"><strong>'.$firstname.' '.$lastname.'</strong></a></td>
        <td><a href="/backend/leads/view/?ID='. $ID.'">'.$partner.'</a></td>
        <td>'.$phonecell.'</td>
        <td><a href="mailto:'. $email.'">'.$email.'</a></td>
        <td>'.date("M jS, g:i A", strtotime($date)).'</td>
        <td>'.$contacttype.'</td>
        <td>'.$agentassigned.'</td>
        <td>'.$leadstatus.'</td>
        <td><a href="/backend/contacts/notes.php?ID='.$ID.'">View</a> +</td>
        <td><a href="/backend/contacts/todo.php?ID='.$ID.'">View</a> +</td>
        <td><a href="/backend/contacts/deletesuccess.php?ID='.$ID.'">D</a></td>
       </tr>
     </tbody>       
    </table>';

}
?>
  • 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-06T14:24:31+00:00Added an answer on June 6, 2026 at 2:24 pm

    In object-oriented mode, the parameter to fetch_array() specifies the fetch type (MYSQLI_ASSOC, MYSQLI_NUM), and doesn’t take a result resource.

    while ($row = $result->fetch_array(MYSQLI_ASSOC)) {
    

    In your loop then, we assume you want to be using keys from $row rather than plain variables. Move the variable assignments into your loop from above.

    while ($row = $result->fetch_array(MYSQLI_ASSOC)) {
    
      // Move these assignments into the loop so they are available to your
      // echo statement when constructing your <tbody>
      $ID = $row ['ID'];     
      $firstname = $row ['firstname'];     
      $lastname = $row['lastname'];
      $partner  = $row['spousefirst'];   
      $phonecell = $row['phonecell'];
      $email = $row['email'];
      $date = $row['date'];
      $contacttype = $row['contacttype'];
      $agentassigned = $row['agentassigned'];
      $leadstatus = $row['leadstatus'];
    
      echo'
     <tbody>       
       <tr>
        <td width="10"><input type="checkbox" name="" id="" value="'.$ID.'"></td>
        <td><a href="/backend/leads/view/?ID='.$ID.'"><strong>'.$firstname.' '.$lastname.'</strong></a></td>
        <td><a href="/backend/leads/view/?ID='. $ID.'">'.$partner.'</a></td>
        <td>'.$phonecell.'</td>
        <td><a href="mailto:'. $email.'">'.$email.'</a></td>
        <td>'.date("M jS, g:i A", strtotime($date)).'</td>
        <td>'.$contacttype.'</td>
        <td>'.$agentassigned.'</td>
        <td>'.$leadstatus.'</td>
        <td><a href="/backend/contacts/notes.php?ID='.$ID.'">View</a> +</td>
        <td><a href="/backend/contacts/todo.php?ID='.$ID.'">View</a> +</td>
        <td><a href="/backend/contacts/deletesuccess.php?ID='.$ID.'">D</a></td>
       </tr>
     </tbody>       
    </table>';
    
    }
    

    Edit

    About your other few questions…

    I would say there isn’t much to gain from storing this in an include file. It isn’t a lot of code, and if you don’t plan on reusing it in other places there won’t be a benefit to moving it out of this file.

    Your query is static, not making use of any PHP variables. It is therefore also not of much benefit to store them in an array, which would then require extra work in PHP to convert into SQL.

    $options = array('Buyer','Seller','Buyer / Seller','Investor');
    // Join them into a string and quote both ends of it.
    // If this includes any user input, you must call `$mysqli->real_escape_string()` on _each_ of them.
    // Since in this one instance it is static in your code though without variables, that isn't necessary here
    $options = "'" . implode("','", $options) . "'";
    $query = ("SELECT * FROM contacts WHERE contacttype IN ($options) AND leadstatus = 'New' ORDER BY date DESC");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Warning: mysqli_close() expects parameter 1 to be mysqli, object given in /home/mjcrawle/public_html/toga/homefile/processlogin.php on line
Warning: array_pop() expects parameter 1 to be array, null given in ... on line
Warning: Parameter 3 to showBlogSection() expected to be a reference, value given in /home/smartsta/public_html/includes/Cache/Lite/Function.php
Warning: Invalid argument supplied for foreach() in /home/content/t/3/k/t3kmast3r/html/PushService.php on line 13 Warning: stream_socket_client() [function.stream-socket-client]:
WARNING: LONG QUESTION. [QUESTION] If the strategy is to have a branch per database,
WARNING: While resolving call to function 'help' arguments were dropped! If I compile using
Output: Warning: mysql_query(): 6 is not a valid MySQL-Link resource in C:...\mysql_helper.php on line
Warning I'm brand new to rails! While reading through a tutorial it has asked
Warning: preg_match_all() [function.preg-match-all]: Unknown modifier 'l' in /var/www/test.php on line 9 It's saying my
Warning: mkdir() [function.mkdir]: No such file or directory in I keep getting this annoying

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.