Require Help regarding Mysql Database (Urgent).

Discussion of programming on Linux, including shell scripting, perl, python, c/c++, mono, java. Whatever tickles your fancy.

Which database you use under Linux.

Oracle
1
9%
MySQL
9
82%
PostgreSQL
1
9%
DB2
0
No votes
 
Total votes : 11

Require Help regarding Mysql Database (Urgent).

Postby hassanmuneer » Sun Oct 03, 2004 10:40 pm

AOA

i use mysql with RH9.and want to save some images in database (gif,jpeg).if anyone know that how to save image file in mysql .Plz Guide me. and i also require help regarding retrive data with the help of c.I know about the c API that is used to retrive data.but i want to discuss some problem with a person that already work on it.

Regards

Ask not what your country can do for you, Ask what you can do for your country
hassanmuneer
Lance Naik
 
Posts: 25
Joined: Fri Apr 09, 2004 4:41 pm
Location: Lahore

Postby jargon » Sun Oct 03, 2004 11:08 pm

You are looking to store binary data, this seems to be a good reference.
http://www.phpbuilder.com/columns/florian19991014.php3
jargon
jargon
Lieutenant Colonel
 
Posts: 691
Joined: Mon Oct 13, 2003 9:40 am

Postby zaeemarshad » Mon Oct 04, 2004 6:21 pm

I would suggest you store the image on the filesystem as a normal file and store the path info in the database. That wont make ur database grow very large . just my 0.02$

cheers
zaeem
zaeemarshad
Lieutenant Colonel
 
Posts: 660
Joined: Sat Jul 06, 2002 12:35 pm
Website: http://zaeem.no-ip.org
WLM: zarshadvirk@hotmail.com
Yahoo Messenger: negativecreep61@yahoo.com
AOL: zarshadvirk
Location: Islamabad

Storing images in MySQL

Postby asaf » Tue Oct 05, 2004 9:20 am

Zaeem's advice is good. You can place a link to the images in the database. However, if you still would like to place the images in the database, the type to use is blob or binary large object.


my 2 cents.

asaf
Asaf Maruf Ali
PING Systems
Network Security-Linux-Consulting
605, 6th Floor,
Clifton Centre, Block 5,
Clifton, Karachi-75600
Pakistan
Tel # 5872438, 5868275, 5833971-2
Fax # 5868927
asaf
Lance Naik
 
Posts: 41
Joined: Wed Aug 07, 2002 8:00 pm
ICQ: 33531649
Website: http://www.ping.com.pk
WLM: asaf_maruf@hotmail.com
Yahoo Messenger: asaf_maruf@yahoo.com
Location: Karachi

Postby saquib_javed » Fri Oct 08, 2004 9:00 pm

disagree

approach is wrong

that guy dont wana use the filesystem

infact in my final year lecture our teacher gave us assignment on this we did it by storing the path of the file but our teacher said 'NO'

:idea:
Use Linux and feel Free.
OR
Feel free to use Linux. ;)
saquib_javed
Naib Subedar
 
Posts: 344
Joined: Sat Apr 10, 2004 9:07 pm
Website: http://www17.brinkster.com/saquibjaved
Location: Karachi

Postby farhantoqeer » Fri Oct 08, 2004 9:52 pm

how did he defend his No?

What was the scenario?
A: Yes
Q: Is top-posting bad?
farhantoqeer
Major General
 
Posts: 917
Joined: Thu Jun 27, 2002 5:45 pm
Website: http://www.emergen.biz
Location: Karachi

Postby saquib_javed » Sat Oct 09, 2004 7:58 am

Dear,

He said NO by giving the reason that if ur on remote system and u want to insert a particular image (from remote system) in databse then it should not store the path because it can be deleted by anyone or anything.

ThanX
Use Linux and feel Free.

OR

Feel free to use Linux. ;)
saquib_javed
Naib Subedar
 
Posts: 344
Joined: Sat Apr 10, 2004 9:07 pm
Website: http://www17.brinkster.com/saquibjaved
Location: Karachi

Sorry for the late response.

Postby hassanmuneer » Fri May 19, 2006 4:49 pm

Thanks for the responses.
Last edited by hassanmuneer on Sat Aug 05, 2006 1:28 am, edited 1 time in total.
hassanmuneer
Lance Naik
 
Posts: 25
Joined: Fri Apr 09, 2004 4:41 pm
Location: Lahore

Postby hassanmuneer » Fri May 19, 2006 4:59 pm

And both the solutions are right depend on the senario , we can save the pictures to the databases and we can also save the paths to the databases. But the later technique is uses in the web enviroment. to reduce the size of the database. But my question is if we save the images in DB or in file system we use the same resources of the system ( i mean storage). The senario is if i want to host my application is some US based server and use the database for storing the images it consume the same space as OS file system and what do you mean by heavy database.
DB are meant to store the information not for the meta data information.

i am waiting for your responses.
hassanmuneer
Lance Naik
 
Posts: 25
Joined: Fri Apr 09, 2004 4:41 pm
Location: Lahore

Postby lambda » Fri May 19, 2006 9:22 pm

hassanmuneer wrote:But my question is if we save the images in DB or in file system we use the same resources of the system ( i mean storage).

no, you always use slightly more resources if you store them in a database: there's the overhead of database tables, indexes, etc. it's also slower to fetch images from a database, you can't get the web server to cache the images in memory (done automatically if the image is served from a local disk), etc. in other words, more cpu resources to serve an image.
The senario is if i want to host my application is some US based server and use the database for storing the images it consume the same space as OS file system and what do you mean by heavy database.

who said anything about a heavy database?

DB are meant to store the information not for the meta data information.

if you have to store a billion images (not unimaginable -- see sites like livejournal.com where paid users can upload hundreds of avatar-type pictures), you really don't want to store all that in a database.

besides, if you store the path to a file in the db, you're storing information: metadata is information.
lambda
Major General
 
Posts: 3452
Joined: Tue May 27, 2003 7:04 pm
Website: http://www.hungry.com/~fn/
Location: Lahore


Return to “%s” Programming

Who is online

Users browsing this forum: No registered users and 1 guest

cron