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!

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.