Advertisement
Guest User

saya

a guest
Nov 17th, 2016
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. <?php
  2.  
  3. function koneksi_db(){
  4.  
  5. $host = "localhost";
  6.  
  7. $database = "comepost_1";//sesuaikan nama db kamu
  8.  
  9. $user = "comepost_user";//sesuaikan usernya, kalau di cpanel usernya ganti juga, biasanya nama user akun cpanel
  10.  
  11. $password="1qwertyuI";// sesuaikan password kamu, kalau di cpanel ganti juga, biasanya password akun cpanel
  12.  
  13. $link = mysql_connect($host,$user,$password);//koneksi ke db
  14.  
  15. mysql_select_db($database,$link);//pilih nama db
  16.  
  17. if(!$link)
  18.  
  19. echo "Error : ".mysql_error();
  20.  
  21. return $link;
  22. }
  23. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement