Current location: Hot Scripts Forums » Programming Languages » PHP » searching image


searching image

Reply
  #1 (permalink)  
Old 08-10-04, 03:25 AM
nurqeen nurqeen is offline
New Member
 
Join Date: Feb 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
searching image

hi..i'm doing a staff directory for my place..where i need to insert the staff informations like name, age, gender, phone no n others, i also would like to upload their image..the system also have a search function to search staff's information with just entering their name or their staff id.

at first i upload the image to the database, i'm using mysql n my code using php..it's work great..but then here's the problem..

when i'm doing my search function..i don't know how to call the image that i've already upload earlier..when i'm doing some finding on the net..i found out that i need to upload the image to the server (i'm using apache server) so that i can store the path to my upload image in my database MYSQL..

and just rite now, i've try to call the image by searching function, but the field for the image only display the path of the image not the image itself..the name,age,gender were display ok..

please,please some one give me the idea..do i have to include the downloading image when i'm doing the searching code or what..

hope some one out there understand my english n my problem..thanxxx yaa..
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 09-10-04, 03:22 AM
han han is offline
Newbie Coder
 
Join Date: Aug 2004
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
ho!
u need to read field that store image bc image in database as binary so u ought to read field binary.
first u need to read image as binary
good luck
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 09-10-04, 06:09 AM
<?Wille?> <?Wille?> is offline
Junior Code Guru
 
Join Date: Jan 2004
Location: Helsinki, Finland
Posts: 666
Thanks: 0
Thanked 0 Times in 0 Posts
store the path/pic name and show it with regular html
fetch the pic and show it like:

<img src="<? echo $thepic; ?>" />
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 07-09-05, 08:58 AM
ashok ashok is offline
New Member
 
Join Date: Jul 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Lightbulb U got it

Using the above said way u got the image

otherwise the path u have set to relative one (i e images/pic1.jpg this image is placed in http://yoursitename/images/pic1.jpg)

then the image display correctly
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #5 (permalink)  
Old 07-09-05, 10:35 AM
FiRe FiRe is offline
Code Guru
 
Join Date: Oct 2004
Location: UK
Posts: 801
Thanks: 0
Thanked 0 Times in 0 Posts
PHP Code:

$UploadedPic file_get_contents($upload);

mysql_query("SELECT picture FROM table WHERE picture LIKE '$UploadedPic'"); 
__________________
Alexa Share <-- Trade virtual shares in websites with this online game.

codR.us <-- Submit and vote for your favorite code snippets with codR.us.

XEWeb.net <-- The ultimate PHP resource network.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need thumbnail image show large image separately, on mouseover Cre8tvnrg JavaScript 12 03-05-08 12:01 PM
how to draw an image inside a table? davidklonski HTML/XHTML/XML 2 07-06-04 11:27 AM
small image script needed. graham barnes Script Requests 0 06-18-04 04:06 AM
need help with upload image and getting image name to db mikewooten PHP 3 05-14-04 05:52 PM
how to change text dynamically with image? rabbit51 JavaScript 1 02-23-04 09:35 AM


All times are GMT -5. The time now is 06:14 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.