Jump to content

TEXT type reading as BLOB


Err

Recommended Posts

I'm trying to get only true BLOB's out of the database and encode them, problem is the TEXT types are also read as BLOB's so my script is encoding the pain text. Is there any way I can differentiate BLOB between TEXT?

Link to comment
Share on other sites

If you're reading from a table you should already know which ones are text and which ones are blobs.The data received from an SQL query is either a string or a number in PHP.

Link to comment
Share on other sites

As far as I know it's actually always a string, I'm pretty sure the mysql extension only returns data as strings. I had to write a method in my database class to pass in a recordset and table name and have it get the column data types and convert each field to the correct PHP type.

Link to comment
Share on other sites

I got it. I used: mysql_query("SHOW FIELDS FROM table");Gives me the right type.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...