Jump to content

Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given


Recommended Posts

Someone help me in this problem please??

Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in line 8

$rec= mysqli_query ($db, "SELECT FROM joborder WHERE id=$id");

$record = mysqli_fetch_array ($rec); // line 8

$fnames= $record ['fnames'] ; 

Edited by kei
19 hours ago, kei said:

Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in line 8

$rec= mysqli_query ($db, "SELECT FROM joborder WHERE id=$id");

$record = mysqli_fetch_array ($rec); // line 8

Taking these statements in order: 

$rec = mysqli_query( $db, "SELECT FROM joborder WHERE id=$id" );

This tries to execute a SQL query and puts the result - hopefully a set of results - into $rec. 
The function can also return false if its execution fails - which it will because your SQL in invalid. (What were you hoping to get from the joborder table?). 

I'll gloss over your SQL Injection Attack vulnerability for now. 

$record = mysqli_fetch_array( $rec ); 
Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in line 8

So now PHP is complaining that you're passing a Boolean value (false) as the first parameter to this function. 

Fix your SQL and try again.  🙂

Regards, 
   Phill  W.

 

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.