Raised This Month: $12 Target: $400
 3% 

SQL Null Values in Blob


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Ingram
Veteran Member
Join Date: May 2004
Old 04-21-2008 , 02:27   SQL Null Values in Blob
Reply With Quote #1

I'm using a blob to store files (in this specific case, plugins) in mysql. The problem is it appears to stop when it hits a null value on a query. In the case of this code, it writes the data that is in the blob up until it hits a null value, then it continues to write nulls. I wasn't sure if this is a bug, which is why I am posting it here first, so any ideas?

for (new i=1;i<=SQL_NumResults(query);i++){
SQL_ReadResult(query, 0, name, 32)
SQL_ReadResult(query, 1, result, 65535)
length = SQL_ReadResult(query, 2)
file = fopen(name, "wb")
fwrite_blocks(file, result, length, BLOCK_BYTE)
fclose(file)
SQL_NextRow(query)
}
Ingram is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 18:00.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode