[plug] Database advice - Newbie

Onno Benschop onno at itmaze.com.au
Tue Jun 24 15:46:06 WST 2003


On Tue, 2003-06-24 at 14:48, James Devenish wrote:
> Hmm, okay, I guess my question is that if that is how you do it, how do
> you make it work? (That was a rhetorical question. If it happens to be
> fairly easy to explain, and you want to bother, then I would benefit
> from the knowledge and would re-examine my existing PHP scripts in
> light of it. But...no pressure.)

I've deleted the rest of this message, since I think it can be
summerized with: "String manipulation isn't obvious or trivial in PHP."
If that is incorrect, please let me know.

So, if that is what you're saying, then - yes - that is true. However, I
think I spent an hour on it once several years ago, wrote three routines
that make the problem go away and now I have complete confidence that
the data I send to my update routine actually ends up in the database.

You make valid points about escaping quotes and binary data, but I can't
say I've ever seen a problem. I have more trouble getting PHP to draw
HTML form elements with pre-filled in user data - single and double
quotes, slashes and the like - but from a database perspective I've not
had any issues.

Perhaps it also assists to know that my routines basically take a record
in the form of an array, which they then construct into an SQL
statement.


Onno Benschop 

Connected via Optus B3 from S33:37'33" - E115:07'30" (Dunsborough, WA)
-- 
()/)/)()        ..ASCII for Onno.. 
|>>?            ..EBCDIC for Onno.. 
--- -. -. ---   ..Morse for Onno.. 

Proudly supported by Skipper Trucks, Highway1, Concept AV, Sony Central, Dalcon
ITmaze   -   ABN: 56 178 057 063   -  ph: 04 1219 8888   -   onno at itmaze.com.au



More information about the plug mailing list