[Phplib-users] Classes, MySQL, Images & phplib
Brought to you by:
nhruby,
richardarcher
From: Mike G. <mi...@op...> - 2001-12-31 15:14:59
|
Hello, I'm having a bit of trouble convincing a phplib class to produce an image from a MySQL database.. So far I've got the following: require("config.php3"); class Image { var $db; function Image() { global $ID; $img->db = new Image; $sql="SELECT photo FROM WLPphoto WHERE profileID='$ID'"; $img->db->query($sql); while($img->db->next_record()) { Header("Content-type: image/jpeg"); echo $this->db->Record[photo]; } } } config.php3 has the database variables defined (much as they are set in phpSlash).. It's been a couple months since I've played with classes, so perhaps it's just that I'm just a bit rusty.. I'd like to generate a script to pull an image out of a database based on a $ID number. This all works fine outside of the phplib environment, but I can't figure out how to get this class to display any results.. Any suggestions? Mike -- Mike Gifford, OpenConcept Consulting, http://www.openconcept.ca Supporting progressive organizations in online campaigns and tools. Feature: Women's Learning Partnership http://learningpartnership.org Truth is that which confirms what we already believe. Northrop Frye |