-2

I have fetching some data in database, if I load the page means it is getting some warning error after the fetch row getting this issue like this(Warning: Trying to access array offset on value of type null in C:\xampp\htdocs).below I have given my PHP code.

Note:I'm getting issue is this line:

$img = $national_images_dir . "/" . $row[1] . "/" . $row[0];

Php code:

while( $line = mysqli_fetch_row($result_set) ) {
        $bridge_name = $line[1] . $line[2] . $line[3] . $line[4] . $line[5];
                   $query = "select image, directory from $images_table where bridge_id = '$line[0]'";
        #print "IMG: ($query)<br>";
                   $res = mysqli_query($maindb_handle, $query) or die(__FUNCTION__." Query Failed ".  "<br>($maindb_handle)<br>MySQL Error[".mysqli_error($maindb_handle)."]");
                   $row = mysqli_fetch_row($res);
                   $img = $national_images_dir . "/" . $row[1] . "/" . $row[0];
Jens
  • 63,364
  • 15
  • 92
  • 104
makizhan
  • 1
  • 1

0 Answers0