php - Inserting MySQL data as an image path -


when try simple code works fine:

<?php require 'connect.php';  if($result = $con->query("select * table")) {     if($row = $result->fetch_object()) {         echo $row->imgname, ' ',$row->divid, '<br>';     } }  ?> 

but inserting image not working reason:

<?php require 'connect.php';  if($result = $con->query("select * table")) {     if($row = $result->fetch_object()) {         echo "<img src='img/".$row['imgname']."' />";     } }  ?> 

can me out, please!

change $row['imgname'] $row->imgname


Comments

Popular posts from this blog

Ansible - ERROR! the field 'hosts' is required but was not set -

customize file_field button ruby on rails -

SoapUI on windows 10 - high DPI/4K scaling issue -