-6

In my code i need to echo $row["description"]; in an image to display value in to display value in the database. The value in the database need to be display in the image. How should I write whole the code that It could echo the value? Any help??

<div class="col-xs-3 col-sm-3 col-md-3">
    <img src="grey.jpg">
    <div class="top-left"> echo $row["description"]</div>
</div>
RiggsFolly
  • 93,638
  • 21
  • 103
  • 149
Pravesh
  • 25
  • 5

2 Answers2

1

Because of the question written I dont know how you connected to the DB, I am assuming you are beginner. First things:

If errors continue

  • var_dump row to see how your data is returned var_dump($row) (maybe the array is multiples dimensions that you are not seeing)
  • Make sure you are echoing <?php echo $row["description"]; ?> in a php extension file, if it is html it will not work
  • If php code and html are two different file.Are you even including the php file in your html? using require or rquire_once?
LukeDS
  • 141
  • 8
0

Try This code

  <div class="top-left"> <?php echo $row["description"]; ?> </div>

OR

<div class="top-left"> <?= echo $row["description"]; ?> </div>
SAVe
  • 814
  • 6
  • 22