What Is A Blob (mysql) - and how do i use it

free web hosting
Open Discussion > CONTRIBUTE > Computers

What Is A Blob (mysql) - and how do i use it

master_bacarra
hey everyone! i just started using mysql so i could integrate it on my site. i'm trying to create a comment section and store the data on mysql. i've defined my table having a field type of varchar with max value 5000. but when i created it on phpmyadmin on my free hosting account, it said that the maximum value for a varchar is just 255. it said that i should use a blob. what is it and how can i access the data using php? i've searched from the net and it said that blob is used for images and document data. and i also found out that the data stored in a blob is a byte... so if i can use blob, how can i convert a text/string to a blob and vice versa. hmm... i'm confused...

oh make that binary, not byte. sorry.

Reply

WindAndWater
Just consider blobs to be longer versions of varchars and use them in exactly the same way. In the phpAdmin or the mysqlAdmin (I don't remember which, as I usually do it manuall) you can change the type of field from varchar to blob. Do that, and then treat the rest exactly the same.

Reply

Inspiron
MySQL treat data unique. Hence there is a difference between Blob and Text. Text simply means a text string stored as orginal, not in binary, whereas a blob is a text string stored as a binary.

You can find more information about data types on the MySQL deocumentations.
http://dev.mysql.com/doc/refman/5.0/en/blob.html

Reply

OpaQue
BLOB and TEXT type as explained in MySQL Language Reference.

QUOTE
A BLOB is a binary large object that can hold a variable amount of data. The four BLOB types TINYBLOB, BLOB, MEDIUMBLOB, and LONGBLOB differ only in the maximum length of the values they can hold.

The four TEXT types TINYTEXT, TEXT, MEDIUMTEXT, and LONGTEXT correspond to the four BLOB types and have the same maximum lengths and storage requirements. The only difference between BLOB and TEXT types is that sorting and comparison is performed in case-sensitive fashion for BLOB values and case-insensitive fashion for TEXT values. In other words, a TEXT is a case-insensitive BLOB.

Reply

master_bacarra
so i could use TEXT instead of BLOB in storing the comments? if so, how long is the maximum length for a TEXT in the free hosting accounts? and if ever i am to use a BLOB, how can i convert it to a non-binary form using php and vice versa?

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.

Recent Queries:-
  1. what is a blob - 3.26 hr back. (1)
  2. mysql blob data type - 7.12 hr back. (1)
  3. mysql delete blob - 14.85 hr back. (1)
  4. mysql difference blob longblob - 16.41 hr back. (1)
  5. mysql blob - 18.13 hr back. (1)
  6. mysql convert blob to text - 14.20 hr back. (3)
  7. php mysql blob to string - 26.09 hr back. (1)
  8. convert a blob back into data php - 38.11 hr back. (1)
  9. difference between blob and text - 42.67 hr back. (1)
  10. maximum size of blob mysql - 44.10 hr back. (1)
  11. "mysql" "string" "blob" - 48.48 hr back. (1)
  12. mysql converting a blob to text - 58.44 hr back. (1)
  13. mysql text longtext blob longblob - 60.71 hr back. (1)
  14. how to use blobs mysql - 62.76 hr back. (1)
Similar Topics

Keywords : blob, mysql

  1. Mysql Changing Date Format
    Need a bit of help changi ng the date format in a table (3)
  2. 2 Mysql Operations Cause Delay?
    (1)
    I'm doing an Inventory system using PHP and MySQL. It's almost done now but I've been
    having a problem with this particular code. This is a function that does two things. It updates a
    table with edited values and then inserts values to another table. It's working fine except
    that the status bar of my browser indicates that the page (with this function) is still loading when
    in fact the function has been terminated and it did its job already (I've checked the dbase) and
    there's no command after calling the function. Could the delay be because ....
  3. Cheat Sheets
    PHP, MySQL, CSS, RGB Hex Color, mod_rewrite (4)
    here are some cheat sheets for PHP, MySQL, CSS, RGB Hex Color, and mod_rewrite. choose one, choose
    all. /smile.gif' border='0' style='vertical-align:middle' alt='smile.gif' /> can be printed as a
    handy reference guide when you are working with any of the above-mentioned interests. just let it
    reside within your reach in your desk, and you'll save some time looking up things online. makes
    a webmaster's life a little bit easier. /smile.gif' border='0' style='vertical-align:middle'
    alt='smile.gif' /> enjoy! http://www.ilovejackdaniels.com/cheat-sheets/ ....
  4. Delphi 2005 + Mysql
    how to connect mysql with delphi 2005? (2)
    Anyone knows how to connect mysql with delphi 2005? Thanks! /smile.gif' border='0'
    style='vertical-align:middle' alt='smile.gif' /> ....
  5. How Do I Delete Info From Mysql Database Through My Cpanle?
    - help (1)
    I want to delete some info in a MySql database. Can I do that through my cPanle? if not, I need to
    know even through command prompt. Thanks\ nickmealey ....
  6. Running Php/mysql/html Offline
    (11)
    Is there programs or a way to run PHP/CGI/MySQL/HTML and other web programming languages offline? I
    am trying to learn website design, and uploading accumulates a very precious part of my time, and
    being able to run the modified file offline would be a -very- great timesaver. Is there anyway to
    install PHP, MySQL and the other languages to your computer so that you may work on things offline,
    like I said?....

    1. Looking for blob, mysql

*RANDOM STUFF*





*SIMILAR VIDEOS*
Searching Video's for blob, mysql

*MORE FROM TRAP17.COM*
advertisement



What Is A Blob (mysql) - and how do i use it



 

 

 

 

ADD REPLY / Got an Opinion! a humble request :-) RAPID SEARCH! Free Hosting [X]
Express your Opinions, Thoughts or Contribute your information that might help someone here.
Ask your Doubts & Queries to get answers.. "Together, We enlight each other!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE