$sth2 = $dbh->prepare( 'insert into catalog values ($words, $index{$words})' );Perl won't interpolate $words because it's inside single quotes. If $words is a string variable, even if it were interpolated, it wouldn't be proper SQL because string values need single quotes around them (in the SQL, not in the Perl). Easiest and best fix is placeholders:
$sth2 = $dbh->prepare('INSERT INTO catalog VALUES(?,?)'); $sth2->execute($words,$index{$words});
In reply to Re^2: Finding local vs Global Error
by jZed
in thread Finding local vs Global Error
by Cappadonna3030
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |