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

Edited by sildona
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.