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
Post a Comment