Re: BLOB Support in DB

From: Date: Wed, 10 Jul 2002 15:07:16 +0000
Subject: Re: BLOB Support in DB
References: 1 2  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-1839@lists.php.net to get a copy of this message
My common.php: ($Id: common.php,v 1.3 2002/05/09 12:29:53 ssb Exp $) has the same prepare() method as your version... I am not to confident in changing any PEAR files, as it might get me in trouble later if I upgrade or something. how should I form my SQL to insert a BLOB? something like this? insert into people (name, photo) values ('John', '/tmp/userfile') regards, David Dahl On Wed, 2002-07-10 at 09:51, Michelle Manning wrote: > Hi David, > We had a lot of problems using pear DB for Blobs and found a couple of things. > 1. in common.php in DB the split is used, but this actually can cause some problems. > so we used preg_split and had to change the & to another character as I was testing > using bit comparison. With that change...it seems to work... > ($Id: common.php,v 1.59.2.3 2001/11/13 01:26:42 ssb Exp $) This is the version that I am > talking about. > > Let me know if there is anything else that would help with BLOBs - we have major work with wavs > and images... > > In DB\common.php > function prepare($query) > { > $tokens = preg_split("/[\^\?\!]/", $query); //changed this line... > $token = 0; > $types = array(); > > for ($i = 0; $i < strlen($query); $i++) { > switch ($query[$i]) { > case '?': > $types[$token++] = DB_PARAM_SCALAR; > break; > case '^': > $types[$token++] = DB_PARAM_OPAQUE; > break; > case '!': > $types[$token++] = DB_PARAM_MISC; > break; > } > } > > Michelle > ----- Original Message ----- > From: David Dahl > To: PEAR > Sent: Wednesday, July 10, 2002 10:32 AM > Subject: [PEAR] BLOB Support in DB > > > Hi: > > I was just wondering how things are going with BLOB support in DB? > > Thanks > > David Dahl > > > -- > PEAR General Mailing List (http://pear.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.pear.general (#1839) next »