Advertisement
Vendettaaaa

Untitled

Jun 30th, 2015
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.52 KB | None | 0 0
  1. <?php
  2. $tf_host = 'localhost' ;
  3. $tf_dbname = 'tinyforum' ;
  4. $tf_username = 'root';
  5. $tf_password = '' ;
  6.  
  7. $tf_handle = mysqli_connect($tf_host , $tf_username , $tf_password);
  8.  
  9.  
  10.  
  11. if (!$tf_handle){  
  12.     die('connection problem ..');
  13. }
  14.  
  15. $tf_db_result = mysqli_select_db($tf_dbname);
  16. if(!$tf_db_result)
  17. {
  18. mysqli_close($tf_handle);
  19. die('selection problem');
  20. }
  21. else{
  22.     die("success");
  23. }
  24.  
  25. mysqli_query($tf_handle, "SET NAMES 'utf8'") ;
  26.  
  27. function tinyf_db_close() {
  28.     global $tf_handle;
  29.     mysqli_close($tf_handle);
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement