if( connect_successful() ){ $var .= $output; } else{ print "Konnte keine Verbindung herstellen"; }