You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: v1/controller/db.php
+2-2
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ public static function connectWriteDB() {
13
13
// database connection muse be a singleton object (there must be a one connection only across your whole project/application, and you just reuse it whenever you need it)
14
14
15
15
if (self::$writeDBConnection === null) { // to start initiation of the connection
16
-
self::$writeDBConnection = newPDO('mysql:host=localhost;dbname=tasksdb;charset=utf8', 'root', '0000'); // Create the database connection
16
+
self::$writeDBConnection = newPDO('mysql:host=localhost;dbname=tasksdb;charset=utf8', 'root', ''); // Create the database connection
17
17
18
18
// Setting some attributes on the connection:
19
19
self::$writeDBConnection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); // the error mode is Exception. They are good because you can catch them, deal with them, and they are a good way to error handling in PHP
@@ -28,7 +28,7 @@ public static function connectWriteDB() {
28
28
publicstaticfunctionconnectReadDB() {
29
29
// Database connection must be a singleton object (there must be a one connection only across/throughout your whole project/application, and you just reuse it whenever you need it)
30
30
if (self::$readDBConnection === null) { // to start initiation of the connection
31
-
self::$readDBConnection = newPDO('mysql:host=localhost;dbname=tasksdb;charset=utf8', 'root', '0000'); // Create the database connection
31
+
self::$readDBConnection = newPDO('mysql:host=localhost;dbname=tasksdb;charset=utf8', 'root', ''); // Create the database connection
32
32
33
33
// Setting some attributes on the connection:
34
34
self::$readDBConnection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); // the error mode is Exception. They are good because you can catch them, deal with them, and they are a good way to error handling in PHP
0 commit comments