18 lines
323 B
PHP
18 lines
323 B
PHP
|
<?php
|
||
|
$dbhost = "localhost";
|
||
|
$dbuser = "root";
|
||
|
$dbpass = "";
|
||
|
$dbname = "ocena_zachowania";
|
||
|
|
||
|
$con = mysqli_connect($dbhost, $dbuser, $dbpass, $dbname);
|
||
|
|
||
|
$ans = mysqli_query($con, "SELECT nazwa_klasy FROM klasy;");
|
||
|
$json = array();
|
||
|
|
||
|
while($row = mysqli_fetch_assoc($ans)) {
|
||
|
$json[] = $row;
|
||
|
}
|
||
|
|
||
|
echo json_encode($json);
|
||
|
?>
|