Help for this page

Select Code to Download


  1. or download this
    sub SQLQuote {
      my ( $data ) = @_;
      $data =~ s/'/\\'/g;
      return $data;
    };
    
  2. or download this
    SELECT * FROM table WHERE name=? AND id=?
    
  3. or download this
    $dsn->Sql($SQL, $name, $id );
    
  4. or download this
    # Code courtesy of kudra++, errors courtesy of me
    $SQL = < SQL;
    ...
    
    $statement = $dbh->prepare( $SQL );
    $statement->execute($name, $id);