mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in editdata.php on line 7 -


<?php $connect = mysqli_connect("localhost","root","","alphacontractsdata"); if(isset($_get['edit_id'])) {  $sql_query = "select * works odos=".$_get['edit_id'];  $result_set = mysqli_query($connect, $sql_query);  $fetched_row = mysqli_fetch_array($result_set); } if(isset($_post['btn-update'])) {   // variables input data  $name = $_post['onomateponumo'];  $odos = $_post['odos'];  $arithmos = $_post['arithmos'];  $perioxi = $_post['perioxi'];  $date = $_post['hmerominia'];  // variables input data   // sql query update data database  $sql_query = "update works set          onomateponumo='$name',odos='$odos',arithmos='$arithmos',perioxi='$perioxi',hmero     minia='$date' user_id=".$_get['edit_id'];  // sql query update data database    // sql query execution function   if(mysql_query($sql_query))   {   ?> 

when run code returns me warning: mysqli_fetch_array() expects parameter 1 mysqli_result, boolean given in c:\wamp64\www\crm\editdata.php on line 7 ideas?

you forget second parameter of myslqi_fetch_array() function. in second parameter telling type of array want return.

// numeric array $row=mysqli_fetch_array($result,mysqli_num); printf ("%s (%s)\n",$row[0],$row[1]);  // associative array $row=mysqli_fetch_array($result,mysqli_assoc); printf ("%s (%s)\n",$row["lastname"],$row["age"]); 

Comments

Popular posts from this blog

account - Script error login visual studio DefaultLogin_PCore.js -

xcode - CocoaPod Storyboard error: -