in reply to Re: how to test a connection with mysql db
in thread how to test a connection with mysql db

But what about: how do I know if my connection is still OK ?
Is there a command to test the connection ? or what is the best way to test this ?

Thanks
Luca
  • Comment on Re^2: how to test a connection with mysql db

Replies are listed 'Best First'.
Re^3: how to test a connection with mysql db
by wazoox (Prior) on Jul 22, 2005 at 07:17 UTC
    You shouldn't have to worry that much about the connection; simply test the return value of each DBI statement, if it fails, then it MAY be because the connection's lost.
    $dbh->something() or .... # put your error management code here
      What if the sql statement is wrong, than it also fails! Is there a difference between both ? Luca
        The error message is different, yes. But it will also vary from a sgbd to another, or from a version to another. You can't really help there.