0

I have form in php which upload photo from computer folder to mysql database. Photos I have in a folder "img" but files added to database are without any folder. How I can change directory?

My code echo is:

echo "<center><img src=" . $row["Photos"] . "></center>";

I've tried something like this:

echo "<center><img src="/img/ . $row["Photos"] . "></center>";

but it doesn't work.

I don't have any idea where I can find solution.

2 Answers2

1

Try echo "<center><img src='/img/" . $row["Photos"] . "'></center>";|

Because your folder img must be in html tag

lozo
  • 11
  • 2
0

Change your code to

echo '<center><img src="/img/' . $row["Photos"] . '"></center>';

You have set your quotes on the wrong char. In this case you must work with single quotes and normal quotes. Or you must encode your douple quotes like this:

echo "<center><img src=\"/img/" . $row["Photos"] . "></center>";
Richard
  • 618
  • 1
  • 9
  • 15