Err Posted June 7, 2011 Report Share Posted June 7, 2011 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 More sharing options...
Ingolme Posted June 7, 2011 Report Share Posted June 7, 2011 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 More sharing options...
justsomeguy Posted June 7, 2011 Report Share Posted June 7, 2011 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 More sharing options...
Err Posted June 8, 2011 Author Report Share Posted June 8, 2011 (edited) I got it. I used: mysql_query("SHOW FIELDS FROM table");Gives me the right type. Edited June 8, 2011 by Err Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now