|
|||
|
Hello all, new user of these forums here...
I am using Zend Framework 0.9.2 in a project for my employer. I am connected to a MySQL DB using the Zend Framework and MYSQLI: Code:
$this->db_dbase = Zend_Db::factory('MYSQLI', $params);
Code:
$sub_table = new subscribers();
$where = array("subscriber_id = '9'");
$values = $sub_table->fetchRow($where);
I would love to post the data contained in the LONGBLOB fields, but each of the two instances that fail the data is over 1K in length (one is near 2K, the other, 4K) - I don't know if it is the data in the field, or the length of the data, or something else. The field was originally populated with large amounts of $_SESSION variable data - it doesn't seem to be encoded or anything (I would have to dig through some old code to find out exactly how it was stored - from the look of the data, it just looks like a straight dump into the field). I plan on just eliminating the data from the field, or dropping the field entirely from the table, which should fix the issue for me. I wanted to post this in case anybody else what experiencing similar issues. I am not sure if this issue affects the current version of the Zend Framework (0.9.3) or not, as I have yet to load it into the system and test. I hope this helps someone out there... |
|
|||
|
Now I have run into a new issue, one which others should be able to replicate, and it appears to only affect MySQL fields of type LONGBLOB. Smaller BLOB field types (ie, MEDIUMBLOB, BLOB, etc) do not appear to be affected.
Basically, I created a table to hold BLOBs for uploaded images. So, I have a table with an ID key field, a field to hold the mime type, and a field to hold the BLOB - plus other fields which aren't important or germane to this discussion. So - when I initially set the field as a LONGBLOB type, I used the Zend Framework to write the data as so: Code:
$table = new blobs();
$values = array("mime_type" => $mime_type, "blob_data" => $data);
$table->insert($values);
Code:
$table = new blobs();
$blob_data1 = $table->getAdapter()->fetchOne("SELECT blob_data FROM blobs WHERE blob_id = '$blob_id'");
Code:
$link = mysql_connect(DB_HOST, DB_USERNAME, DB_PASSWORD);
mysql_select_db(DB_DBNAME);
$result = mysql_query("SELECT blob_data FROM blobs WHERE blob_id = '$blob_id'");
$blob_data2 = mysql_result($result, 0);
Code:
for ($i=0; $i < 5; $i++) {
print "<hr>";
print "COMPARE=".$i;
print "<p>";
print "SUBSTR1=".substr($blob_data1, $i, 1).", ".ord(substr($blob_data1, $i, 1));
print "<p>";
print "SUBSTR2=".substr($blob_data2, $i, 1).", ".ord(substr($blob_data2, $i, 1));
}
Quote:
I don't know if this issue and the prior issue are related, but I find it interesting that they both have to do with the same field type. For my current development efforts, I can switch the field to a MEDIUMBLOB type, but it would be handy in the future to be able to use the LONGBLOB type, as I might have BLOBs which are larger than 16Mb in size that I would want to store in the DB. I am wondering if I am running into an issue involving multi-byte ASCII, Unicode, and locale setting issues. Does anyone else think this may be the case, and if so, how I might correct it? Or, is this really a bug with the Zend Framework? Once again, I find it strange that it only seems to affect the LONGBLOB field type, and none of the other BLOB types, and only on reading the field, not writing it (ZF appears fine in this regard). I suppose it could be an issue with MySQL or how it is set up, but the inconsistency of what I am seeing doesn't seem to support it (although I am looking at it from my developer perspective, and not from a DB admin perspective - I am going to talk to my IT guys about this, too). If anybody has any clues as to what is going on, I am all ears... |
|
||||
|
hmm, I'm clueless... perhaps posting on the mailing list will have more intelligent responses than me.
__________________
SpotSec Network Gateway Project on SourceForge SpotSec Network Gateway Project Home SpotSec Blog: http://spotsec.com/blog |
![]() |
| Thread Tools | |
| Display Modes | |
|
|