Loading ...
Sorry, an error occurred while loading the content.
 

Re: DBI / DBD(xy) are already installed, and NOW ?!?

Expand Messages
  • Csongor Fagyal
    ... Well... You just use ASP and mix it with whatever Perl functionality you like. But let me write an example for you... x.asp :
    Message 1 of 9 , Jan 28, 2003
      mnobrebr wrote:

      >Ok Csongor Fagyal, you're right !
      >For now I have DBD::mysql and DBD::Pg installed.
      >
      >Viewing the man pages, it seems to me that the instructions concerns
      >to purely Perl or I am wrong ?
      >
      >Where (site or tutorial) do I can find some sample code of Apache::ASP
      >with Perl (embeded or somewhat) working with DBI/DBD ?
      >
      >Thanks In Advance.
      >
      >Marcos Nobre.
      >
      >
      Well...

      You just use ASP and mix it with whatever Perl functionality you like.
      But let me write an example for you...

      x.asp :

      <%
      # Connect
      my $dbh = DBI->connect("DBI:mysql:database=test;host=host:port", 'user',
      'pass');

      # Check error (or use eval + RaiseError)
      if ($dbh->errstr) {
      $Response->AppendToLog($dbh->errstr);
      $Response->End;
      }

      # Fecth something from DB
      my ($value) = $dbh->selectrow_array('SELECT field FROM table LIMIT 0,1',
      undef);

      # You should have something in $value now
      %>

      <html>
      <body>
      Here is the result of your query: <%= $value %>
      </body>
      </html>


      Got the point?

      - Cs.


      ---------------------------------------------------------------------
      To unsubscribe, e-mail: asp-unsubscribe@...
      For additional commands, e-mail: asp-help@...
    Your message has been successfully submitted and would be delivered to recipients shortly.