PEAR Forum :: PHP Extension and Application Repository

PEAR Forum Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
MDB2 - Text & BLOB return stream

 
Post new topic   Reply to topic    PEAR Forum Forum Index -> Database
View previous topic :: View next topic  
Author Message
jakenoble



Joined: 31 Aug 2007
Posts: 22

PostPosted: Sun Nov 25, 2007 11:23 pm    Post subject: MDB2 - Text & BLOB return stream Reply with quote

Hi

Suddenly some of my fields of type text or blob are returning a resource #id.

If I do a var_dump on this resource it says it is 'of type stream'.

Any ideas how I can stop this happening, or how I can read the data out of the stream?

Thanks

Jake
Back to top
View user's profile Send private message
mark



Joined: 07 Jan 2007
Posts: 1053

PostPosted: Mon Nov 26, 2007 1:38 am    Post subject: Reply with quote

http://pear.php.net/manual/en/package.database.mdb2.intro-fetch.php, almost at the end of the page
Back to top
View user's profile Send private message
jakenoble



Joined: 31 Aug 2007
Posts: 22

PostPosted: Mon Nov 26, 2007 9:46 am    Post subject: Reply with quote

Thanks for the info.Now I can get the data out in a useful fashion.

But why is this happening? I have been using binary text fields since I started coding this project, many weeks ago. Why have I only just come across this? All other attempts to access the data has given me a simple string.

Thanks, Jake
Back to top
View user's profile Send private message
mark



Joined: 07 Jan 2007
Posts: 1053

PostPosted: Mon Nov 26, 2007 11:23 am    Post subject: Reply with quote

What are "all other attempts"? Did you use MDB2 before? IIRC MDB2 does this "stream way" every time, while other abstraction layers return the contents of BLOBs/CLOBs just as every field, e.g. like a simple string.
Back to top
View user's profile Send private message
jakenoble



Joined: 31 Aug 2007
Posts: 22

PostPosted: Mon Nov 26, 2007 1:44 pm    Post subject: Reply with quote

Yes I have used MDB2 on several other pages to access the same field in the same table. The other uses all have returned a simple string.

I have not seen or used IIRC MDB2 anywhere.

The only difference 'I think' is that the stream version returns every row in the table using query(), all other uses of this table return just one row using getRow().
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    PEAR Forum Forum Index -> Database All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



PEAR Forum topic RSS feed 
Powered by phpBB © 2001, 2005 phpBB Group

Provided by Ministry of Web developement

'Actiemonitor' online projectmanagement software