Create_Database PHP

 script this time we are still discussing about the connection to the database .. I previously had mengeshare to make connections now I share how to make in order to connect to the MySQL database we have created through PHPmyadmin.....
 Copy this script or any type of initial create_DB.php then saved with the name or whatever you like
survived Coding..happy coding :)


<html>
    <head>
        <title>
            Menggunakan MYSQL create_DB
        </title>
    </head>
    <body>
        <?php
            $host="localhost";
            $user="sandroid";
            $pass=" ";
            $database="db_guestbook";
            $konek="mysql_connect($host, $user, $pass)" or die("koneksi gagal dilakukan:". mysql_error());
            if (mysql_create_db($database))
            {
                echo"Database $database telah dibuat";
            }
 else {
     echo"gagal dalam membuat database".mysql_error();
    }
    mysql_close($konek);
           
        ?>
    </body>
</html>

Posted in , . Bookmark the permalink. RSS feed for this post.

Leave a Reply

Pages

Search

Sandiah Notes Template Sandroid11.blogspot.com.