Think about Loose Coupling | |
PerlMonks |
Re: Converting from MySQL to SQLiteby Tomte (Priest) |
on Jul 29, 2004 at 08:58 UTC ( [id://378325]=note: print w/replies, xml ) | Need Help?? |
The code and error/problem-information you provided are insufficient to help you. to me at least $harga = 0, $harga2 = kan.$harga; doesn't make any sense, and perl doesn't like it that much either: so I can't help you with your problem, as the SQL itself looks fine:
2 more notes to make your job easier in the future: 1. Always check for the return-value of anything that can produce errors and indicates errors via the return-value, including $dbh->prepare(), as ysth already said.
2. Don't interpolate data into SQL when not technically necessary (e.g. dynamically inserting the tablename): write and give $companyid as a parameter to $sth2->excute() (as in $sth2->excute($companyid)), or use $dbh->quote() before you interpolate: To adopt the practice of using placeholders if you use SQL in any language you programm in, greatly increases the quality and security of your code.
regards,
An intellectual is someone whose mind watches itself.
In Section
Seekers of Perl Wisdom
|
|