LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] Perl / MySQL oddity

[ILUG] Perl / MySQL oddity

Nick Hilliard nick at iol.ie
Tue Apr 25 15:31:26 IST 2000


> > On a stylistic point, the recommended way to do this sort of thing is:
> > 
> > $sth = $dbh->prepare("INSERT INTO $table $Fields VALUES (?,?,?,?,?,?,?)");
> > $sth->execute(	$Description, substr($Description, 0, 50),
> > 		$2, $Keywords, $UnixPath, $MacPath, $Volume);
> 
> I tried using this syntax at some stage but had some kind of problem with it
> and didn't keep trying. However, 

Really?  What sort of problems did you have?

> > This gets around the need to mess around with quoting things all over the
> > place.  
> 
> I'm not sure that this is right. DBI->quote is to quote strings being passed
> to the server. I don't see how passing them via these bound parameters
> gets around this necessity.

I phrased that badly.  What I meant to say was "This gets around the need to
_explicitely_ quote things all over the place".  It's simply a neater
interface than messing around with DBI->quote, but does the same thing by
FETCH'ing them from within the execute() code, rather than by passing them
directly to do() and then execute().

Your problem is curious though.  I've looked at the XS code for quote() and
execute() but rapidly got lost in there (must dig out my perl internals book
one of these days).

Nick





More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell