Author Topic: Easy Way to Post pictures with PHP  (Read 220 times)

0 Members and 1 Guest are viewing this topic.

Offline huntrguy102Topic starter

  • Irregular
    • View Profile
Easy Way to Post pictures with PHP
« on: March 17, 2010, 04:15:19 PM »
I have a site with books in a database.  I also have the names of the books corresponding with the I.D. number of the book in the database (i.e. 001.jpg = Book 1). So my question is, is their an way to post the pictures next to the information of the books on a page.  I already have it so the information of the books (title, author, genre, etc.) are posted on a page, I just need the pictures (or thumbnails) next to them to show up.  Any help would be appreciated.

Offline fenway

  • MySQL Si-Fu / PHP Resident Alien
  • Global Moderator
  • 'Insane!'
  • *
  • Gender: Male
    • View Profile
Re: Easy Way to Post pictures with PHP
« Reply #1 on: March 22, 2010, 04:25:32 PM »
I don't follow... why not join the tables?
:anim_rules: Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.

Offline huntrguy102Topic starter

  • Irregular
    • View Profile
Re: Easy Way to Post pictures with PHP
« Reply #2 on: March 29, 2010, 10:51:29 AM »
well the problem I am having is that I don't know how to have pictures in a database and then use php to post the images.

Offline HavokDelta6

  • Enthusiast
    • View Profile
Re: Easy Way to Post pictures with PHP
« Reply #3 on: April 01, 2010, 12:36:19 PM »
Just echo it, make sure you're storing them in a binary colomn - Blob, i'd also store a mime type:

in php: "

header('content-type: img/jpg');
echo($image_binary_data);
"

sorted

PHP Freaks Forums

« on: »

Tired of these ads? Purchase a supporter subscription to get rid of them.