Advertisement
AleeFerreira

cls - connect.php

Aug 10th, 2013
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.41 KB | None | 0 0
  1. <?php
  2.  
  3. $db_user = "root";
  4. $db_pass = "";
  5. $db_host = "localhost";
  6. $db_name = "clsv1a0";
  7.  
  8. $connect = mysql_connect($db_host,$db_user,$db_pass);
  9. if (!$connect) {
  10.     echo "<script>alert('Não foi possível conectar ao banco de dados MySQL.');</script>";
  11. } else {
  12.     $db = mysql_select_db($db_name);
  13.    
  14.     if (!$db) {
  15.         echo "<script>alert('Não foi possível conectar ao banco de dados $db_name.');</script>";
  16.     }
  17. }
  18. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement