-5

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> 
1
  • You should put php code in php tag, like <?php echo $row["description"] ?> Commented May 7, 2019 at 10:19

2 Answers 2

2

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?
Sign up to request clarification or add additional context in comments.

Comments

0

Try This code

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

OR

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

2 Comments

No its not working it does not show anything at all . I don't know why.. Any help ?
@Pravesh : Please show your whole page including php

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.