File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change 1
1
# Fletty
2
2
3
- HUSK lag en fil for databasetilkobling:
3
+ HUSK lag en fil for databasetilkobling
4
+
5
+ I php-fila:
4
6
5
- <? php
6
7
$IPAdresse = "localhost";
7
8
$databasenavn = "";
8
9
$brukernavn = "";
9
10
$passord = "";
10
11
11
12
$db = new mysqli($IPAdresse, $brukernavn, $passord, $databasenavn);
12
13
$db->set_charset('utf8mb4');
13
- /*
14
+
14
15
print "Prøver å opprette kobling til " . PHP_EOL;
15
16
print "maskin (" . $IPAdresse . "), " . PHP_EOL;
16
17
print "database (" . $databasenavn . "), " . PHP_EOL;
17
18
print "brukernavn (" . $brukernavn . "), " . PHP_EOL;
18
19
print "passord (" . $passord . ")" . PHP_EOL;
19
- */
20
+
20
21
if ($db->connect_errno > 0){
21
22
print "Kunne ikke koble til database (" . $db->connect_error . ")" . PHP_EOL;
22
23
}
23
- /*
24
+
24
25
else {
25
26
print "Koblet til database" . PHP_EOL;
26
27
}
@@ -32,5 +33,4 @@ if (!mysqli_query($db,$sql))
32
33
echo("Error description: " . mysqli_error($db));
33
34
}
34
35
35
- */
36
- ?>
36
+
You can’t perform that action at this time.
0 commit comments