Skip to content

Commit d26aca7

Browse files
author
cecilie hansen rørås
committed
Readme
1 parent 8e5a266 commit d26aca7

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,27 @@
11
# Fletty
22

3-
HUSK lag en fil for databasetilkobling:
3+
HUSK lag en fil for databasetilkobling
4+
5+
I php-fila:
46

5-
<?php
67
$IPAdresse = "localhost";
78
$databasenavn = "";
89
$brukernavn = "";
910
$passord = "";
1011

1112
$db = new mysqli($IPAdresse, $brukernavn, $passord, $databasenavn);
1213
$db->set_charset('utf8mb4');
13-
/*
14+
1415
print "Prøver å opprette kobling til " . PHP_EOL;
1516
print "maskin (" . $IPAdresse . "), " . PHP_EOL;
1617
print "database (" . $databasenavn . "), " . PHP_EOL;
1718
print "brukernavn (" . $brukernavn . "), " . PHP_EOL;
1819
print "passord (" . $passord . ")" . PHP_EOL;
19-
*/
20+
2021
if ($db->connect_errno > 0){
2122
print "Kunne ikke koble til database (" . $db->connect_error . ")" . PHP_EOL;
2223
}
23-
/*
24+
2425
else {
2526
print "Koblet til database" . PHP_EOL;
2627
}
@@ -32,5 +33,4 @@ if (!mysqli_query($db,$sql))
3233
echo("Error description: " . mysqli_error($db));
3334
}
3435

35-
*/
36-
?>
36+

0 commit comments

Comments
 (0)