SSH2 if login failed = exit. PHP
<p>how would i make this code, exit or quit if the login to the ssh2 fails.</p>

<pre><code>            $query = mysql_query("SELECT * FROM ssh2");
            while($row = mysql_fetch_array($query)){
            $ip = $row['ip'];
            $user = $row['user'];
            $pass = $row['pass'];
            $ssh = ssh2_connect($ip, 22);
            ssh2_auth_password($ssh, $user, $pass);
</code></pre>
