Topic: insert picture in the databse
How do i insert a picture in the database.
What should be the data type
Just like you have used it in the insertion of an avatar.
Thank you
regards francis
You are not logged in. Please login or register.
PunBB Forums → Programming → insert picture in the databse
How do i insert a picture in the database.
What should be the data type
Just like you have used it in the insertion of an avatar.
Thank you
regards francis
Moved to Programming
Avatars are not stored in the database. However, the correct datatype would be blob (in MySQL)
no real sense in storing images into a db.. and yeah its a BLOB (binary large object), either way you do it, it's going to take up hdd space.
Couldn't you use a string type too, and escape the binary data? dono what the limits on string types are in mysql though
Couldn't you use a string type too, and escape the binary data? dono what the limits on string types are in mysql though
why would you?
if you database was sqlite you might have to, I can't remember atm but i think there's only number and string data types. Also, as string, you could perform string based searches for the file type from the files header. Many file types have the first 2-4 bytes as chars specifying their format.
Also, as string, you could perform string based searches for the file type from the files header. Many file types have the first 2-4 bytes as chars specifying their format.
That sounds horrible I would think it would be much more efficient to store than info in another field and search that.
Meh, i was just trying to think up excuses, to sound smart
either way though, files are the way to store files, not databases XD
Couldn't you use a string type too, and escape the binary data? dono what the limits on string types are in mysql though
you mean a TEXT datatype? feh. not a good idea.
anyways, read all you want on TEXT -vs- BLOB here: http://dev.mysql.com/doc/refman/5.0/en/blob.html
PunBB Forums → Programming → insert picture in the databse
Powered by PunBB, supported by Informer Technologies, Inc.