Stopping Page Execution : Exit : Language Basics PHP Source Code


PHP Source Code » Language Basics » Exit »

 

Stopping Page Execution




<?php
     $db_conn = mysql_connect ("imaginaryhost""navioo""password");
   
     // If no db connection, exit script
     if(!$db_conn)
     {
          print("<b>I could not connect to the database! :(</b><br />");
          print("This script will now exit<br />");
          exit;
     }
   
     mysql_close($db_conn);
?>
           
       



HTML code for linking to this page:

Follow Navioo On Twitter

PHP Source Code

 Navioo Language Basics
» Exit