-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGLOBAL.php
41 lines (33 loc) · 876 Bytes
/
GLOBAL.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
// Globais
$base_url = "https://happening-builders.000webhostapp.com/";
$pag_atual;
$raiz = __DIR__;
function getAssets(){
global $base_url;
return $base_url . "assets/";
}
// Novos dados de hospedagem
$base_dados = [
"host" => "localhost",
"user" => "id21684629_admin",
"password" => "",
"database" => "id21684629_sebastiao_alves_bd"
];
$pdo = new PDO("mysql:host=" . $base_dados["host"] . ";port=" . $base_dados["port"] . ";dbname=" . $base_dados["database"], $base_dados["user"], $base_dados["password"]);
//Funçoes
function selectSQL($sql){
global $pdo;
$query = $pdo->query($sql);
return $query->fetchAll(PDO::FETCH_ASSOC);
}
function selectSQLUnico($sql){
global $pdo;
$query = $pdo->query($sql);
return $query->fetch(PDO::FETCH_ASSOC);
}
function iduSQL($sql){
global $pdo;
$pdo->query($sql);
}
?>