I have a connection problem, where it displays the following error:
Parse error: syntax error, unexpected end of file in /var/www/html/showdospes.com.br/web/funcao/conecta.php on line 27
Since line 27 does not exist it only goes to 26, what is the correct way to close the script? aki the code:
<?php
function conecta( ){
if(!defined("HOST")){
define('HOST','localhost');
}
if(!defined("BD")){
define('BD','bala');
}
if(!defined("USER")){
define('USER','bombom');
}
if(!defined("PASS")){
define('PASS','chocolate');
}
try {
$conn = new PDO('mysql:hostname='.HOST.';dbname='.BD.';port=3306','.USER.','.PASS.');
}catch(Exception $e){
echo $e -> getmessage();
}
return $conn;
}