Advertisement
garfield

[MySQL]: Deletar DataBase em MySQL

Feb 2nd, 2012
279
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.65 KB | None | 0 0
  1. /*
  2.                         @Função: Deletar DataBase em MySQL
  3.                         @Créditos: SuYaNw Dácio
  4.  
  5.  
  6.                         http://suyanwdacio.blogspot.com/
  7. */
  8.  
  9.  
  10. // Deletar DataBase, CreateDataBaseInMySql("Ip hosting","Usuário","Senha","DataBase Nome");
  11. //  return 1, verdadeiro se foi deletado com sucesso, returne false se não existe este db, caso der erro,
  12. // returna ao erro mysql.
  13. function DeleteDataBaseInMySql($host, $user, $pas, $db)
  14. {
  15.     $c = mysql_connect($host, $user, $pas);
  16.     $crate = "DROP DATABASE ".$db."";
  17.     if(mysql_query($crate, $c))
  18.     {
  19.         return 1;
  20.     }
  21.     else
  22.     {
  23.         return 0;
  24.     }
  25.     return mysql_error();
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement