-1

I changed my *.html file into *.php. It seemed okay, but after I click the button for image it doesn't show the picture. IN *.html file it was working.

My code:

<img src="C:\xampp\htdocs\Bella Cristina/diamond.jpg" alt="Diamond Room" style="width:200px;height:200px;">
Community
  • 1
  • 1
Norby
  • 1
  • 1

1 Answers1

0

Firstly, you have to make sure that the image exist in your image folder. Insert the name of the folder and the image into a field in your table in the database.

To display it write thees lines of PHP code:

    // this will display the image with the size reduced or increased by  180px by 180px
    echo '<img src="'.$row['field'].'" '.'width="180px"'.' '.'height="180px"'.'>';

    ?>

Note: the $connection much be existing in your connection string that is connecting the database