nafees Posted December 3, 2008 Share Posted December 3, 2008 hello there, i'm facing problems retrieving BLOB values in a text area box. Can anyone tell me how to retrieve the values of the blob field. also plz tell me how to get the original data from the encrypted binary BLOB data. Regards, Nafees Quote Link to comment https://forums.phpfreaks.com/topic/135406-mysql-blob-data-type/ Share on other sites More sharing options...
corbin Posted December 3, 2008 Share Posted December 3, 2008 Depends what kind of data is in there.... BLOB is just binary. Luckily, with PHP, handling BLOB stuff isn't too hard. It's actually just about like a normal column. $q = mysql_query("SELECT some_blob_column FROM some_table LIMIT 1"); $r = mysql_fetch_row($q); echo $r[0]; for example. Quote Link to comment https://forums.phpfreaks.com/topic/135406-mysql-blob-data-type/#findComment-705454 Share on other sites More sharing options...
nafees Posted December 4, 2008 Author Share Posted December 4, 2008 hello there, thanks a lot for ur reply. i was looking to add a Microsoft Word formated document into the BLOB data field. My objective is to retrieve tht formated data from the BLOB field using php. can u tell me how to do tht. I can retrieve plain text data but failed to retrieve the formated one. Regards, Nafees Quote Link to comment https://forums.phpfreaks.com/topic/135406-mysql-blob-data-type/#findComment-705601 Share on other sites More sharing options...
corbin Posted December 4, 2008 Share Posted December 4, 2008 <?php //pretend $q is a query resource if($q && mysql_num_rows($q)) { $r = mysql_fetch_assoc($q); header("Content-Type: application/msword"); //not sure if application/msword is actually the word document MIME type //I doubt it is, but I don't feel like Googling. echo $r['blob_column_name']; } Quote Link to comment https://forums.phpfreaks.com/topic/135406-mysql-blob-data-type/#findComment-705616 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.