Jump to content

TEXT type reading as BLOB


Err
 Share

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.

Edited by Err
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...