Help for this page

Select Code to Download


  1. or download this
    $month=`date --date='1 month ago' +%B`;
    my $sth = $dbh->prepare("SELECT * from $table where monthname(Date)='$
    +month'" );
    
  2. or download this
    Microsoft Windows [Version 6.1.7601]
    Copyright (c) 2009 Microsoft Corporation.  All rights reserved.
    
    C:\Users\alex>date --date='1 month ago' +%B
    The system cannot accept the date entered.
    Enter the new date: (dd-mm-yy)
    
  3. or download this
    my $month=(localtime())[4]+1;
    ...
    my $sth=$dbh->prepare("SELECT * from $table where month(Date)=?");
    $sth->execute($month);
    ...
    
  4. or download this
    my $month=(localtime())[4]+1;
    # last month:
    ...
    my $sth=$dbh->prepare("SELECT * from $table where month(Date)=?");
    $sth->execute($month);
    ...
    
  5. or download this
    my $lastmonth=(localtime())[4]||12;
    ...
    my $sth=$dbh->prepare("SELECT * from $table where month(Date)=?");
    $sth->execute($lastmonth);
    ...
    
  6. or download this
    ...
    my $sth=$dbh->prepare('SELECT * from '.$dbh->quote_identifier($table).
    +' where month(Date)=?');
    ...