kei Posted March 8, 2021 Share Posted March 8, 2021 (edited) 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 March 8, 2021 by kei Quote Link to comment https://forums.phpfreaks.com/topic/312259-warning-mysqli_fetch_array-expects-parameter-1-to-be-mysqli_result-boolean-given/ Share on other sites More sharing options...
Barand Posted March 8, 2021 Share Posted March 8, 2021 Then your query failed and returned "false" instead of a valid result. Check mysqli error message. Quote Link to comment https://forums.phpfreaks.com/topic/312259-warning-mysqli_fetch_array-expects-parameter-1-to-be-mysqli_result-boolean-given/#findComment-1584957 Share on other sites More sharing options...
Phi11W Posted March 9, 2021 Share Posted March 9, 2021 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. Quote Link to comment https://forums.phpfreaks.com/topic/312259-warning-mysqli_fetch_array-expects-parameter-1-to-be-mysqli_result-boolean-given/#findComment-1584966 Share on other sites More sharing options...
dodgeitorelse3 Posted March 10, 2021 Share Posted March 10, 2021 What are you selecting from joborder? Quote Link to comment https://forums.phpfreaks.com/topic/312259-warning-mysqli_fetch_array-expects-parameter-1-to-be-mysqli_result-boolean-given/#findComment-1585001 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.