-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
  • 29,742
  • 25
  • 114
  • 177
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,264
  • 5
  • 24
  • 44
0
echo "<img src=\"$row['logo']\" />";

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

gogaz
  • 2,123
  • 1
  • 24
  • 30