View Single Post
  #2   Spotlight this post!  
Unread 02-03-2004, 09:17
Brandon Martus's Avatar Unsung FIRST Hero
Brandon Martus Brandon Martus is offline
busy.
AKA: B. Slash Kamen
no team
 
Join Date: May 2001
Rookie Year: 1998
Location: Nevada, TX USA
Posts: 5,271
Brandon Martus has a reputation beyond reputeBrandon Martus has a reputation beyond reputeBrandon Martus has a reputation beyond reputeBrandon Martus has a reputation beyond reputeBrandon Martus has a reputation beyond reputeBrandon Martus has a reputation beyond reputeBrandon Martus has a reputation beyond reputeBrandon Martus has a reputation beyond reputeBrandon Martus has a reputation beyond reputeBrandon Martus has a reputation beyond reputeBrandon Martus has a reputation beyond repute
Send a message via ICQ to Brandon Martus Send a message via AIM to Brandon Martus Send a message via Yahoo to Brandon Martus
Re: online scouting database + picture question

Quote:
Originally Posted by Robert Hafner
I'm using a MySQL database to run the scouting program, and I was wondering if it was possible to store pictured into the database. I know the blob type is for storing binary data, but how would I go about putting a picture in there, and then how would I have it display?
here's some snippets. nothing complete, but it'll get you on the right track, i think.

grab the file, first.
Code:
	  @ob_start();
  	  $output = @readfile("/path/to/file.jpg"); // could be url
  	  $theImage = @ob_get_contents();
  	  @ob_end_clean();
and then run this insert
Code:
"INSERT INTO table (id,column) VALUES ('','".addslashes($theImage)."')"'
to display later, assuming its a jpeg:
Code:
@header('Content-Type: image/jpeg');
 // echo out contents of that column you just updated
__________________
Brandon Martus
e-mail