Title: DB Images
Last modified: August 21, 2016

---

# DB Images

 *  [coleburg](https://wordpress.org/support/users/coleburg/)
 * (@coleburg)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/db-images/)
 * Could you please let me know if this plug in supports the return of Database 
   images, such as jpeg? this would be incredibly useful
 * thank you.
 * [https://wordpress.org/plugins/dbview/](https://wordpress.org/plugins/dbview/)

Viewing 15 replies - 1 through 15 (of 36 total)

1 [2](https://wordpress.org/support/topic/db-images/page/2/?output_format=md) [3](https://wordpress.org/support/topic/db-images/page/3/?output_format=md)
[→](https://wordpress.org/support/topic/db-images/page/2/?output_format=md)

 *  Thread Starter [coleburg](https://wordpress.org/support/users/coleburg/)
 * (@coleburg)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/db-images/#post-4889003)
 * If not, what about hyperlinks?
 *  Plugin Author [john ackers](https://wordpress.org/support/users/john-ackers/)
 * (@john-ackers)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/db-images/#post-4889065)
 * There’s no special support for images.
 * It looks as if database images could be introduced into the HTML inline if you
   send to the browser encoded in base64. You should be able to create those encodings
   from jpegs using `string base64_encode ( string $data )` in a PHP snippet. But
   you could quickly get into performance issues.
 * Do you mean hyperlinks in a column in the database – in which case yes. You just
   use a PHP snippet in a column to wrap the link in that column with the associated
   text (in another database column) with a pair A tags. There are hyperlinks in
   the example snippets that navigate wp_post etc. But will post an simple example
   if you need one.
 * John
 *  Thread Starter [coleburg](https://wordpress.org/support/users/coleburg/)
 * (@coleburg)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/db-images/#post-4889069)
 * I have just tried the following
 * SELECT ColA, ‘<img src=”[https://www.google.co.uk/images/srpr/logo11w.png&#8221](https://www.google.co.uk/images/srpr/logo11w.png&#8221);/
   >’ AS ‘ColB’
    FROM `TableA`
 * But this just shows the URL. What am I doing wrong?
 * thanks
 *  Plugin Author [john ackers](https://wordpress.org/support/users/john-ackers/)
 * (@john-ackers)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/db-images/#post-4889073)
 * This usable SQL does not work for me either: `SELECT ID, ‘<img src=”[https://www.google.co.uk/images/srpr/logo11w.png&#8221](https://www.google.co.uk/images/srpr/logo11w.png&#8221);/
   >’ AS ‘ColB’
    FROM wp_posts limit 2`
 * I am not sure what’s wrong. If I use chrome inspect element, your HTML is there
   but greyed out. I think there maybe some level of anti HTML injection going on
   somewhere.
 * However this works, try a PHP snippet above the first column, your google image
   is displayed
    `return "<img src=\"https://www.google.co.uk/images/srpr/logo11w.
   png\" />";`
 * This also works: try using the SQL
    SELECT ID, ‘[https://www.google.co.uk/images/srpr/logo11w.png&#8217](https://www.google.co.uk/images/srpr/logo11w.png&#8217);
   AS ‘ColB’ FROM wp_posts limit 2 with the PHP snippet return “<img src=’$value’/
   >”;
 *  Thread Starter [coleburg](https://wordpress.org/support/users/coleburg/)
 * (@coleburg)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/db-images/#post-4889076)
 * Thank you for your reply although I don’t fully understand the php snippet return
   thing. Could you please explain that part in more detail as I thought I could
   only enter a simple query
 *  Thread Starter [coleburg](https://wordpress.org/support/users/coleburg/)
 * (@coleburg)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/db-images/#post-4889078)
 * Ive got it 🙂 ive managed to get the images to display, the only problem is making
   the image a clickable link. Any ideas?
 * thanks again
 *  Plugin Author [john ackers](https://wordpress.org/support/users/john-ackers/)
 * (@john-ackers)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/db-images/#post-4889079)
 * Ok. Are you using just SQl or SQL + php, I am not sure where we are starting 
   from.
 *  Thread Starter [coleburg](https://wordpress.org/support/users/coleburg/)
 * (@coleburg)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/db-images/#post-4889081)
 * Im not 100% sure, just SQL i think. this is what im trying to do
 * [http://www.predictresults.co.uk/test/](http://www.predictresults.co.uk/test/)
 * if you look at the flashing gifs, I just want those to be clickable links.
 * Many thanks for your help
 *  Thread Starter [coleburg](https://wordpress.org/support/users/coleburg/)
 * (@coleburg)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/db-images/#post-4889086)
 * I’ve tried adding href to the snippets but either I’ve added it incorrectly or
   its not supported.
 * Can you let me know if its possible please
 * Thank you
 *  Plugin Author [john ackers](https://wordpress.org/support/users/john-ackers/)
 * (@john-ackers)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/db-images/#post-4889090)
 * If you this SQL
 * `SELECT ID, 'https://www.google.co.uk/images/srpr/logo11w.png' AS 'image', 'http://
   www.google.com' as 'link' FROM wp_posts limit 2`
 * and this PHP snippet above the link column
 * `return "<a href='".$value."'><img src='".$row['image']."'./>/a>";`
 * you can click on the images in the 3rd column and get taken to google.
 *  Thread Starter [coleburg](https://wordpress.org/support/users/coleburg/)
 * (@coleburg)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/db-images/#post-4889093)
 * Excellent, the link works but is there a way to hide the url in the image column
   as this doesnt need to be seen?
 * thank you
 *  Plugin Author [john ackers](https://wordpress.org/support/users/john-ackers/)
 * (@john-ackers)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/db-images/#post-4889095)
 * Yes, someone has raised that before. My only suggestion is to use CSS to hide
   the column or put
 * `return '';`
 * as a PHP snippet in the top of the unwanted column which will blank the column.
   Put the the column in the middle of the table and make it a feature! There does
   need to be a clean way to suppress display columns and sorry don’t have time 
   to implement on this at moment.
 *  Thread Starter [coleburg](https://wordpress.org/support/users/coleburg/)
 * (@coleburg)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/db-images/#post-4889097)
 * I was so close, but so far away, the code worked, wasnt ideal with the extra 
   header but I could live with that.
 * Turns out the DBView hates using this when the Tables return 0 data.
 * Rather than return 0 it just spins and spins 🙁
 * have a look at [http://www.predictresults.co.uk/full-list-of-football-tips/](http://www.predictresults.co.uk/full-list-of-football-tips/)
 * 4 Star Home Wins is pretty good, but then look at 4 Star Low Scoring, its knackered
 *  Thread Starter [coleburg](https://wordpress.org/support/users/coleburg/)
 * (@coleburg)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/db-images/#post-4889098)
 * Ive had to remove it, the error im getting is
 * Warning: array_key_exists() expects parameter 2 to be array, null given in /BLAR
   BLAR/wp-content/plugins/dbview/DBViewTable.class.php on line 188
 * Warning: array_key_exists() expects parameter 2 to be array, null given in /BLAR
   BLAR/wp-content/plugins/dbview/DBViewTable.class.php on line 188
 * Warning: Cannot modify header information – headers already sent by (output started
   at /BLAR BLAR/wp-content/plugins/dbview/DBViewTable.class.php:188) in /BLAR BLAR/
   wp-content/plugins/dbview/DBView.class.php on line 654
    {“success”:true,”messages”:[],”
   updates”:[{“html”:”\r\n<\/tbody>\r\n<\/table style=’width:98%’>”}],”_ajax_nonce”:”
   f459d6368c”} 0 items<\/span><\/th><\/tr> Bet Now<\/span><\/th> ..<\/span><\/th
   ><\/tr><\/thead>\r\n
 *  Plugin Author [john ackers](https://wordpress.org/support/users/john-ackers/)
 * (@john-ackers)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/db-images/#post-4889099)
 * Sorry. Try returning one space. Or
 * `return "&nbsp;" ;`

Viewing 15 replies - 1 through 15 (of 36 total)

1 [2](https://wordpress.org/support/topic/db-images/page/2/?output_format=md) [3](https://wordpress.org/support/topic/db-images/page/3/?output_format=md)
[→](https://wordpress.org/support/topic/db-images/page/2/?output_format=md)

The topic ‘DB Images’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/dbview.svg)
 * [dbview](https://wordpress.org/plugins/dbview/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/dbview/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/dbview/)
 * [Active Topics](https://wordpress.org/support/plugin/dbview/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/dbview/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/dbview/reviews/)

 * 36 replies
 * 2 participants
 * Last reply from: [john ackers](https://wordpress.org/support/users/john-ackers/)
 * Last activity: [12 years ago](https://wordpress.org/support/topic/db-images/page/3/#post-4889156)
 * Status: not resolved