I'm using php and myslqi data base and images that are referenced by the data base only show the little image icon and not the image!
it does show up when I transfer it to the web! the code I'm using is ```$staff_pic_file = mysqli_result($result, $x, 'staff_pic_file');```
followed by ``` echo "<img class='img-responsive' src = '$staff_pic_file' />";```
Any help would be appreciated, John
only image icon shows up
-
- Rank 0 - Newcomer
- Posts: 4
- Joined: Sat Oct 29, 2011 9:12 am
only image icon shows up
I think this may be a double post as I entered all this info befor but it does not show up...sorry if it is.
I am working in php and mysqli and when i call up an image referenced by the data base it ony brings up an image icon and won't open the image!
this is the code I'm using ``` $staff_pic_file = mysqli_result($result, $x, 'staff_pic_file');```
```echo "<img class='img-responsive' src = '$staff_pic_file' />"; ```
It does open the image when I upload it to the web!
Thanks, John
I am working in php and mysqli and when i call up an image referenced by the data base it ony brings up an image icon and won't open the image!
this is the code I'm using ``` $staff_pic_file = mysqli_result($result, $x, 'staff_pic_file');```
```echo "<img class='img-responsive' src = '$staff_pic_file' />"; ```
It does open the image when I upload it to the web!
Thanks, John
- Albert Wiersch
- Site Admin
- Posts: 3785
- Joined: Sat Dec 11, 2004 9:23 am
- Location: Near Dallas, TX
- Contact:
Re: only image icon shows up
Hello,
Have you checked the server/PHP logs for messages that might be helpful?
What is the HTML source code that is being generated by the PHP that is showing the image icon?
Have you checked the server/PHP logs for messages that might be helpful?
What is the HTML source code that is being generated by the PHP that is showing the image icon?
Albert Wiersch, CSS HTML Validator Developer • Download CSS HTML Validator FREE Trial
-
- Rank 0 - Newcomer
- Posts: 4
- Joined: Sat Oct 29, 2011 9:12 am
Re: only image icon shows up
Hi Albert,
This is the code I' am using to bring up the image and all it shows is a black image icon.
"<img class='img-responsive' src = '$staff_pic_file' />";
This is the code I' am using to bring up the image and all it shows is a black image icon.
"<img class='img-responsive' src = '$staff_pic_file' />";
- Albert Wiersch
- Site Admin
- Posts: 3785
- Joined: Sat Dec 11, 2004 9:23 am
- Location: Near Dallas, TX
- Contact:
Re: only image icon shows up
Then $staff_pic_file must be a bad/invalid URL. What does $staff_pic_file equal when it doesn't work? And when it works?
Going to need a lot more information to debug. Without more detail, it will be very difficult to debug.
Going to need a lot more information to debug. Without more detail, it will be very difficult to debug.
Albert Wiersch, CSS HTML Validator Developer • Download CSS HTML Validator FREE Trial
-
- Rank 0 - Newcomer
- Posts: 4
- Joined: Sat Oct 29, 2011 9:12 am
Re: only image icon shows up
Just got it figured out...Albert Wiersch wrote: ↑Wed Nov 13, 2019 10:20 pm Then $staff_pic_file must be a bad/invalid URL. What does $staff_pic_file equal when it doesn't work? And when it works?
Going to need a lot more information to debug. Without more detail, it will be very difficult to debug.
The upload file needs to be in the same directory as the main file showing the images...
You can't put it in an admin file and add ../uploads/etc.jpg because the file showing the jpg does not like the ,,/
John