[Ilugc] Extract file from a blob field in mysql

  • From: webrsk.ideas@xxxxxxxxx (Senthil Kumar_Rsk)
  • Date: Wed Jul 14 00:58:43 2010

On Tue, Jul 13, 2010 at 7:14 PM, Girish Venkatachalam <
girishvenkatachalam@xxxxxxxxx> wrote:

On Tue, Jul 13, 2010 at 5:52 PM, Shrinivasan T <tshrinivasan@xxxxxxxxx>
wrote:
Friends.

I have a mysql database.
In a table, there is a blob field.
In that blob field, there is a html file.

That content is rendered in a page.

I want to change the content of that html file in the blob filed.

How to extract the html file from blob field?


You can only do it with a perl DBI interface.

Not with sqlite3> sql commands by hand.

-Girish


--
Gayatri Hitech
web: http://gayatri-hitech.com

SpamCheetah Spam filter:
http://spam-cheetah.com
_______________________________________________
ILUGC Mailing List:
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc


Hi Shrini,

Easy way would be : If you have the existing html then just change the
contents of that html file and edit the blob field and update this file. I
have tried and it works.

To read the contents try out this query :
SELECT SUBSTRING(blobfield FROM 1 FOR 32000) FROM tablename;
This returns the string of that blob content.

Another way would be using fbsql_read_blob php function. More :
http://php.net/manual/en/function.fbsql-read-blob.php

Regards,
Senthil RSK

Other related posts: