PDA

View Full Version : database pictures?



slayerment
November 16th, 2002, 01:33 AM
how could i make it so when people search my database certain pictures come up with the results. ive got all my tables set up for certain things but i dont know how i would go about thumbnail pictures. i dont need to have the search for the pictures. i just want them to come up according to what item they go with. make sense? im using mySQL by the way. thanks!

Bezzer
November 16th, 2002, 08:33 AM
I havn't done much with MySQL...but you would just use the data base the same way you usualy would...

if ur using PHP you would probably do some thing like this...


<img src="<?php echo $picname ?>" width="blah" height="blah">

Its the same as loading a usual image..only you echo the name of the image from the database...you would probably know how to do that...

Hope this helps :)

slayerment
November 16th, 2002, 12:12 PM
ya i am using php too, but how would i store a picture on my database? ive never done this. thanks!

Bezzer
November 17th, 2002, 05:30 AM
you would just store the address for the picture, not the actual picture. You could make it so that you have a file browser on your new post page. the file selected is uploaded, and the name is stored in something like "picture"...then with ur php you would do something like

<img src="folder/<?php echo $picture; ?>.jpg" height="40" width="40">

IceCube
November 19th, 2002, 01:16 PM
actually.. theres another way too... you can store a binary element in the database using the col type: blob (binary large object) in which you can store pictures and files... though it makes the db slower and heavier... but it still works...

slayerment
November 20th, 2002, 01:21 AM
i got it working. i put the img url on my db and do it that way. thx!

Bezzer
November 20th, 2002, 06:29 AM
no problem :) i'm glad it helped :P