Nextrek
Diff Revisions
578
vs
579
for /Android/SmartCharging/endPoints/get_avatar.php
|
@@ -5,9 +5,9 @@ |
5 |
5 |
|
require_once("repositories/UserRepository.php"); |
6 |
6 |
|
require_once("constants.php"); |
7 |
7 |
|
|
8 |
|
- |
$servername = "localhost"; |
|
8 |
+ |
/*$servername = "localhost"; |
9 |
9 |
|
$username = "smartcharging"; |
10 |
|
- |
$password = "LXRLBaEAuRr7M7jY"; |
|
10 |
+ |
$password = "LXRLBaEAuRr7M7jY";*/ |
11 |
11 |
|
|
12 |
12 |
|
//$params = json_decode($_REQUEST["params"], true); |
13 |
13 |
|
|
|
@@ -20,7 +20,7 @@ |
20 |
20 |
|
$object; |
21 |
21 |
|
|
22 |
22 |
|
try { |
23 |
|
- |
$conn = new PDO("mysql:host=".$servername.";dbname=smartcharging", $username, $password); |
|
23 |
+ |
$conn = new PDO("mysql:host=".DB_SERVERNAME.";dbname=".DB_NAME, DB_USERNAME, DB_PASSWORD); |
24 |
24 |
|
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); |
25 |
25 |
|
//echo "Connesso con successo al DB"; |
26 |
26 |
|
|
|
@@ -32,9 +32,10 @@ |
32 |
32 |
|
catch(PDOException $e) |
33 |
33 |
|
{ |
34 |
34 |
|
echo $e->getMessage(); |
35 |
|
- |
$risposta["return"] = 1; |
|
35 |
+ |
$risposta = createErrorMessage(1, "Errore DB"); |
|
36 |
+ |
/*$risposta["return"] = 1; |
36 |
37 |
|
$risposta["id"] = -1; |
37 |
|
- |
$risposta["avatar"] = ""; |
|
38 |
+ |
$risposta["avatar"] = "";*/ |
38 |
39 |
|
} |
39 |
40 |
|
|
40 |
41 |
|
echo json_encode($risposta); |