Hi,
I have the following problem:
I open a file and store the data to an array.
Then I use
foreach my $tempLine (@indata)
{
my $sth = $dbh->prepare("Select iid from users where id='$tempLine'")
$dbh->execute();
}
*Note: the real code is tested the only error is the quotes.
The problem is that no matter if I use $dbh->quote($tempLine)
or $temp = q($tempLine) or any other way to put the parameter in the query with single quotes ut never works.
The query is ok and it works if I input the parameter normaly, with no variable.
As well I used print to see the output of the quotation and I ALWAYS get this:
'12356
''12315
''21354
etc...
I am using ActivePerl in WindowsXP and Notepad with UTF-8 setting as an editor.
Any help appreciated as this is really getting on my nerves!!!!!!!!!
Thanks
stelios
I have the following problem:
I open a file and store the data to an array.
Then I use
foreach my $tempLine (@indata)
{
my $sth = $dbh->prepare("Select iid from users where id='$tempLine'")
$dbh->execute();
}
*Note: the real code is tested the only error is the quotes.
The problem is that no matter if I use $dbh->quote($tempLine)
or $temp = q($tempLine) or any other way to put the parameter in the query with single quotes ut never works.
The query is ok and it works if I input the parameter normaly, with no variable.
As well I used print to see the output of the quotation and I ALWAYS get this:
'12356
''12315
''21354
etc...
I am using ActivePerl in WindowsXP and Notepad with UTF-8 setting as an editor.
Any help appreciated as this is really getting on my nerves!!!!!!!!!
Thanks
stelios