RE: [PEAR-DEV] some DB::quote() options?

From: Date: Thu, 30 Oct 2003 21:04:15 +0000
Subject: RE: [PEAR-DEV] some DB::quote() options?
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-23146@lists.php.net to get a copy of this message
> From: Analysis & Solutions [mailto:danielc@analysisandsolutions.com] > Sent: Thursday, October 30, 2003 5:06 PM > > IIRC DB should only turn php null's into SQL NULL's and not empty > strings. > > True. But if the field is NOT NULL then folks will run into problems. > > Hmm... I was thinking about cases where the field is char(), but what > about numeric fields... I guess that's when the second parameter I'm > proposing, $type, comes in to return 0 instead of ''. But if ist a NOT NULL field and the pass nothing to DB then maybe it was an error they would want to spot instead of it silently being interpreted as an empty string. Then again the same problem exists when you allow null values and you accidently pass a php null. I think we had this suggestion before and it basically said that you would handle this sort of stuff inside your code to prevent guess work on the part of DB. > By LOB you mean things like BLOB? I haven't seen the quote() functions > doing anything differently for them. Yes. quote() just covers the all strings basically. I think I just created confusion with my answer. So to be more exact. PEAR DB either lets you manually quote or not quote. Anything else is upto you. Regards, Lukas

« previous php.pear.dev (#23146) next »