-2

i keep on getting this error each time i try to set the image height and width. i tried everything to fix this, including fixing the image height and width using css but still it doesn't work. any suggestions?

this is my code:

 <?php
    $db=mysqli_connect("localhost","root","","wallpapers"); 
    $result=mysqli_query($db,"SELECT * FROM `desktop_wallpapers`");
    while($row=mysqli_fetch_array($result)){
        echo "<img src=".$row['image']." height="200">";
    }
    ?>
Kethmie Perera
  • 83
  • 1
  • 1
  • 5

1 Answers1

1

Replace this line (concatenation error).

echo "<img src=".$row['image']." height="200">";

with this

echo '<img src="'.$row['image'].'" height="200">';

you should used single quote ' outside of html and double quote " inside on html tag attributes

Bilal Ahmed
  • 4,005
  • 3
  • 22
  • 42