Jump to content

[SOLVED] WHY?- Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result


CMK08

Recommended Posts

Hello there,

 

Last night I worked on this script on my mac os x and everything was working beautifully. This morning I came to work to test the same script on a windows machine - apache 2.2.8, php 5.2.6, mysql 5.0.51b - and now I get this warning:

 

Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in C:\wamp\www\downloads\zipplet.php on line 19

 

Warning: mysqli_free_result() expects parameter 1 to be mysqli_result, boolean given in C:\wamp\www\downloads\zipplet.php on line 27

 

Here is the code:

 

<?PHP
require_once('../connect.php');
//initiates the array to build form

$fileList2 = array();

//this is a place holder for data coming from log in

$user_id=2;

//select query to display only data belonging to current user

$qry = "Select user_name, rpt_name  FROM data_reports_users where user_id=$user_id";

$r = mysqli_query($dbc,$qry);

//retrieve data from query result and put it in $fileList2

while ($row = mysqli_fetch_array($r, MYSQLI_ASSOC)){

$fileList2[] = $row['rpt_name'];

	  		  
}


mysqli_free_result($r);

mysqli_close($dbc);

 

Any ideas?

 

Thanks!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.