Nextrek
Diff Revisions
578
vs
579
for /Android/SmartCharging/endPoints/registrazione_locale.php
|
@@ -13,9 +13,9 @@ |
13 |
13 |
|
|
14 |
14 |
|
require_once("utilities.php"); |
15 |
15 |
|
|
16 |
|
- |
$servername = "localhost"; |
|
16 |
+ |
/*/*$servername = "localhost"; |
17 |
17 |
|
$username = "smartcharging"; |
18 |
|
- |
$password = "LXRLBaEAuRr7M7jY"; |
|
18 |
+ |
$password = "LXRLBaEAuRr7M7jY";*/*/ |
19 |
19 |
|
|
20 |
20 |
|
//$params = json_decode($_REQUEST["params"], true); |
21 |
21 |
|
|
|
@@ -32,7 +32,7 @@ |
32 |
32 |
|
$local_repo; |
33 |
33 |
|
|
34 |
34 |
|
try { |
35 |
|
- |
$conn = new PDO("mysql:host=".$servername.";dbname=smartcharging", $username, $password); |
|
35 |
+ |
$conn = new PDO("mysql:host=".DB_SERVERNAME.";dbname=".DB_NAME, DB_USERNAME, DB_PASSWORD); |
36 |
36 |
|
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); |
37 |
37 |
|
//echo "Connesso con successo al DB"; |
38 |
38 |
|
|
|
@@ -98,9 +98,10 @@ |
98 |
98 |
|
catch(PDOException $e) |
99 |
99 |
|
{ |
100 |
100 |
|
echo $e->getMessage(); |
|
101 |
+ |
$risposta = createErrorMessage(3, "Errore DB"); |
101 |
102 |
|
$risposta["user_id"] = -1; |
102 |
103 |
|
$risposta["local_id"] = -1; |
103 |
|
- |
$risposta["return"] = 3; |
|
104 |
+ |
//$risposta["return"] = 3; |
104 |
105 |
|
} finally { |
105 |
106 |
|
$conn = null; //Close the connection to the DBMS |
106 |
107 |
|
} |