MySql and Images

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
sathenzar
Forum Newbie
Posts: 2
Joined: Sat Jan 24, 2004 7:27 pm

MySql and Images

Post by sathenzar »

Hey everyone, while I was creating my forum board I came across a problem, how do you store images in a database table? Like under a table I've made called usrs I would like an image field. How would you do this?
And one mroe question....so I don't have to login every time I want to make a post how can i just log in once? I was going to use cookies but I was told that they are to easy to break into and arn't good to hold people out. And I would to it by using the "somepage.php?usraccount=whoever&pass=mypassword" but then anyone can just look at their history. So anyone have any ideas? Thanks.
Straterra
Forum Regular
Posts: 527
Joined: Mon Nov 24, 2003 8:46 am
Location: Indianapolis, Indiana
Contact:

Post by Straterra »

Use md5 encryption if you are going to store people's passwords into a cookie.What I would do, is store both the persons username and password (MD5 Encrypted), and then some key phrase in between, that way you could kind of know if people tampered with it if the key phrase was in the middle or not.
fractalvibes
Forum Contributor
Posts: 335
Joined: Thu Sep 26, 2002 6:14 pm
Location: Waco, Texas

Post by fractalvibes »

If you are wanting to store images in a table, store them as a BLOB.
Be sure and store the MIME type also so that you can handle multiple formats - gif,jpeg,png,etc.

fv
microthick
Forum Regular
Posts: 543
Joined: Wed Sep 24, 2003 2:15 pm
Location: Vancouver, BC

Post by microthick »

This is the tutorial I learn from to store images in a db.

http://www.phpbuilder.com/columns/florian19991014.php3
sathenzar
Forum Newbie
Posts: 2
Joined: Sat Jan 24, 2004 7:27 pm

Wow, didn't expect that many...cool

Post by sathenzar »

Hey, thanks I wans't ecpecting any replies yet. Kool, and thanks for the links, I'm looking at them now. And to Straterra, I agree with the motto completly :D
Post Reply