Hi ?
I have a small problem.
When I run this sql-query in mysql prompt, it works fine:
SELECT s.name, CONCAT('"',f.lastname, '"')AS lastname FROM `firsttable` f, `secondtable` s WHERE f.id = s.tID AND something="1";
RESULTS:
Mike "Johnson"
Elton "John"
But. When I try to run this query in perl-program I get errors because of CONCAT
String found where operator expected
My sql-query looks like this:
my $sql = "SELECT s.name, CONCAT('"',f.lastname,'"')AS lastname FROM `firsttable` f, `secondtable` s WHERE f.id = s.tID AND something='$variableID'";
my $sth = $database_connection->prepare($sql);
$sth->{RaiseError} = 1;
$sth->execute();
my $reference;
$reference = $sth->fetchall_arrayref;
So how I should write this CONCAT that I can run it into my perl prgram ?