Err Posted June 7, 2011 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 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 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 Share Posted June 8, 2011 I got it. I used: mysql_query("SHOW FIELDS FROM table");Gives me the right type. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.