Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ================ File connection.php ====================
- <?php
- function connectionDB() {
- global $mysqli;
- $mysqli = mysqli_connect( "localhost", "root", "", "mahasiswa" );
- if ( mysqli_connect_errno() ) {
- printf( "Connect failed: %s\n", mysqli_connect_error() ;
- exit();
- }
- }
- ?>
- ================== Other files =====================
- <?php
- include "connection.php";
- connectionDB();
- $sql = "INSERT INTO Bla bla... ";
- //etc ..
- ?>
Advertisement
Add Comment
Please, Sign In to add comment