MySQL - Display BLOB and INSERT INTO BLOB

Inserting into a BLOB is just as easy as inserting into any field.

Here is the example query that we can use to change a "field" to "Insert Value":

UPDATE table SET field = 's:12:"Insert Value"' WHERE id = 'uniqueid';

Here is how we can display info from BLOB into text.

SELECT CONVERT(table.blobfield, CHAR(32767)) AS blob_value FROM table;

Other CONVERT types available:
BINARY[(N)]
CHAR[(N)]
DATE
DATETIME
DECIMAL[(M[,D])]
SIGNED [INTEGER]
TIME
UNSIGNED [INTEGER]

Tags:

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
If you have questions about anything on this site, you can find me on Google+: