M
Martin Lee
Hello everyone, I'm a tiro in Perl. Today I have a question about DBI:
In a pl file, I had assign variable $ny = 2011 , I wanna get something from MySQL by DBI
$sth = $dbh->prepare('select site,ip,time,files from sj where time like "2011%" order by id desc');
but I wanna use $ny instead of 2011, I have try :
$sth = $dbh->prepare('select site,ip,time,files from sj where time like "$ny%" order by id desc');
but it's doesn't work
How can I do ?
Thanks!
In a pl file, I had assign variable $ny = 2011 , I wanna get something from MySQL by DBI
$sth = $dbh->prepare('select site,ip,time,files from sj where time like "2011%" order by id desc');
but I wanna use $ny instead of 2011, I have try :
$sth = $dbh->prepare('select site,ip,time,files from sj where time like "$ny%" order by id desc');
but it's doesn't work
How can I do ?
Thanks!