17 lines
373 B
PHP
17 lines
373 B
PHP
<?php
|
|
function getdb(){
|
|
$servername_fonte = "localhost";
|
|
$username_fonte = "root";
|
|
$password_fonte = "";
|
|
$db_fonte = "nome_database";
|
|
try {
|
|
|
|
$conn_fonte = mysqli_connect($servername_fonte, $username_fonte, $password_fonte, $db_fonte);
|
|
}
|
|
catch(exception $e)
|
|
{
|
|
echo "Connection fallita: " . $e->getMessage();
|
|
}
|
|
return $conn_fonte;
|
|
}
|
|
?>
|