Second, you should be using the DBI quote method or placeholders (my preference is placeholders), instead of pasting your variables directly into the sql statement. Placeholders would save you from all that backwhacking of quotes, and in some databases you'd use single instead of double quotes to quote the args, so if you ever migrated, it'd save one extra headache. Placeholders don't get you alot efficiency-wise in mysql, its true, but in combination with prepare_cached can save a bit in statement handle creation (of course then the dbh would have to be persistent also using connect_cached or a package global or as an object attribute or something...).
Third, I think its kind of pointless to copy all those parameters to local args, just to paste them into the sql statement. I'd do something like the insert_hash example in the DBI docs. If this InsertProspect method is already in your main Prospect (or whatever you're calling it) class/package, then I'd not use the accessor methods and just use a hash slice (assuming your object IS a hash underneath) to get all the names and values for the insert statement.
In reply to Re: MySQL / DBI / OOP
by runrig
in thread MySQL / DBI / OOP
by rogueFalcon
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |