Created
June 12, 2017 18:13
-
-
Save Jurigag/802aafe887534636dec570104e6eeae6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$database = "dbname"; | |
$username = "root"; | |
$password = ""; | |
$pdo = new PDO("mysql:dbname=$database;host=127.0.0.1", $username, $password); | |
$query = "SELECT uczen.imie, uczen.nazwisko FROM uczen"; | |
$result = $pdo->query($query); | |
require "view.phtml"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
</head> | |
<body> | |
<ol> | |
<?php foreach($result as $row): ?> | |
<li><?= $row['imie'] ?> <?= $row['nazwisko'] ?></li> | |
<?php endforeach; ?> | |
</ol> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment