-2

PHP Parse error: syntax error, unexpected '' (T_ENCAPSED_AND_WHITESPACE), expecting identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING)

used

echo img src=$row['logo']>."<br />";

what is the correct use

I wanted to show it as a picture

dreftymac
  • 31,404
  • 26
  • 119
  • 182
ilker
  • 21
  • 1
  • 3

3 Answers3

4
<?php

echo "some string {$variable['withKey']}";

encapsulate the variable with { and }

Michal Bieda
  • 954
  • 5
  • 13
4

You have to change your code as below:

echo "<img src='$row[logo]' /><br />";

OR

echo "<img src='".$row[logo]."' /><br />";
B. Desai
  • 16,414
  • 5
  • 26
  • 47
0
echo "<img src=\"$row['logo']\" />";

notice the quotes around your src attribute which are needed for your HTML to work

gogaz
  • 2,323
  • 2
  • 23
  • 31