Jump to content

Displaying An Image Listed In A Database And In A File Folder


sildona

Recommended Posts

I have a PHP file that queries Mysql and displays information. The images that are named in the database reside physically in a directory.

 

The file works just fine -- if I place it directly in the image folder and call it from there.

 

What I need to do is paste it in Wordpress and call it using a shortcode. However, when i paste the file in a Wordpress page, it won't work (I have the Allow PHP in Posts plugin), so the file is being run from the plugins directory, so it doesn't reach the necessary directory.

 

What line of code can I insert to make the file read the image directory? Below is what I'm using now.

 

echo "<img src='".$imgrow[image]."' height='120' />"; (where $imgrow is the mysql fetch and "image" is the field in the database.

 

 

thanks

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.