Jump to content
Sign in to follow this  
b1naryc0de

Simpan Gambar Dalam Mysql

Recommended Posts

Tumpang lalu.. Mintak tolong boleh?? Camner nak simpan gambar dalam mysql?? Aku nak pakai php dengan mysql untuk simpan gambar dalam database..

*maaf kalo soalan ni dah selalu ditanya unsure.gif

Share this post


Link to post
Share on other sites

simpan gambar atau sebarang bentuk binary dengan menggunakan type blob... tapi sebaiknya jangan simpan gambar dalam database, tapi simpan nama fail gambar tu dalam database

lepas tu gunakan nama fail tu untuk point pegi folder kat mana gambar tu disimpan.

Share this post


Link to post
Share on other sites

Maksud ko simpan link untuk gambar tue dalam database tapi gambar tu simpan dalam folder gambar.. gitu??

Tapi kenapa ko kata sebaiknya jangan simpan gambar dalam database sebaliknya hanya simpan reference fail tersebut?? Adakah sebab untuk mengelakkan slow pada database?? Atau ada lagi sebab2 lain??

Edited by b1naryc0de

Share this post


Link to post
Share on other sites

kalau simpan binary, nanti saiz database tu jadi besar giler.. access akan jadi slow, nak buat backup dan restore pun susah..

tapi kalau simpan reference, reference tu hanyalah teks ASCII jer, kecik...

Share this post


Link to post
Share on other sites

Actually.... Size sesuatu database tu tak der jadi masalah kalau kiter index betul betul table yang dah sedia ader. Simpan gambar dalam database ni actually not a very common practive. people tend to save FILES instead pictures sebab converion back of the binary kepada imag file on application akan effect System performance..(but we are talking just MILI SECONDS) Image file and text file is about the same thing. Optimzation is all depends on the index of the record. Yang akan slow nanti for sure is back up and restore due to the nature of the data size.

Tapi I agree with mr sharuzzaman bab simpan Link/Path for the images somewhere else.

Step

Orlando, FL 32807

Share this post


Link to post
Share on other sites

[sharuzzaman,Jun 26 2005, 07:37 PM]

tapi sebaiknya jangan simpan gambar dalam database, tapi simpan nama fail gambar tu dalam database

lepas tu gunakan nama fail tu untuk point pegi folder kat mana gambar tu disimpan.

bole korang terangkan kat aku pasal benda ni. lebih² lagi ayat nih:

gunakan nama fail tu untuk point pegi folder kat mana gambar tu disimpan.

camne lak kalu guna VB?

Share this post


Link to post
Share on other sites

camne lak kalu guna VB?

kalau guna VB, agak sukar sikit, sebab lain komputer, lain path dia..

kalau specifically guna untuk VB, mungkin kena simpan jugak la dalam database.

alternatif lain, fetch gambar untuk papar dalam VB tu guna HTTP. maknanya dalam server database tu, ada gak web server.. so, boleh guna konsep simpan path dalam database, simpan fail dalam folder..

Share this post


Link to post
Share on other sites

Just sugesttion.. gambar tu simpan dalam same network.. Share la mana mana folder yang boleh accessible for anybody within the network... Another method simpan kat WEB directory and you can retrive the image via HTTP and IP link.

Step

Share this post


Link to post
Share on other sites

saya pun nak simpan gambau dlm database tp sy guna ms sql server + visual studio 2005 + asp.net + vb...dalam form yg ada personal detail tp nak save gmbar skali...simpan dlm db coz in future when they wat search..kuar detail with the gmbar skali..tolong la ajau sya step by step..dah buntu nie,dateline pun dh lepas...if nak save link in db..pls tell me how...pls..pls...thx anyway...

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...