# Database pictures?

**URL:** https://forum.kirupa.com/t/database-pictures/8228
**Category:** Uncategorized
**Created:** [November 16, 2002, 6:33am UTC](https://forum.kirupa.com/t/database-pictures/8228 "2002-11-16T06:33:29Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![slayerment](https://avatars.discourse-cdn.com/v4/letter/s/a6a055/32.png) [@slayerment](https://forum.kirupa.com/u/slayerment)
#### Post date: [November 16, 2002, 6:33am UTC](https://forum.kirupa.com/t/database-pictures/8228/1 "2002-11-16T06:33:29Z")

</div>

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!

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [November 16, 2002, 1:33pm UTC](https://forum.kirupa.com/t/database-pictures/8228/2 "2002-11-16T13:33:21Z")

</div>

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…

```php
<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 🙂

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [November 16, 2002, 5:12pm UTC](https://forum.kirupa.com/t/database-pictures/8228/3 "2002-11-16T17:12:05Z")

</div>

ya i am using php too, but how would i store a picture on my database? ive never done this. thanks!

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [November 17, 2002, 10:30am UTC](https://forum.kirupa.com/t/database-pictures/8228/4 "2002-11-17T10:30:22Z")

</div>

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

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

```

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [November 19, 2002, 6:16pm UTC](https://forum.kirupa.com/t/database-pictures/8228/5 "2002-11-19T18:16:41Z")

</div>

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…

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [November 20, 2002, 6:21am UTC](https://forum.kirupa.com/t/database-pictures/8228/6 "2002-11-20T06:21:52Z")

</div>

i got it working. i put the img url on my db and do it that way. thx!

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [November 20, 2002, 11:29am UTC](https://forum.kirupa.com/t/database-pictures/8228/7 "2002-11-20T11:29:44Z")

</div>

no problem 🙂 i’m glad it helped 😛
