Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $servername = "localhost";
- $username = "admin";
- $password = "admin";
- $dbname = "aufgabe02";
- function Refresh()
- {
- $con = new mysqli("localhost", "admin", "admin", "aufgabe02");
- $con = new mysqli($servername, $username, $password, $dbname);
- if(!$con)
- {
- die("Connection Problem: ". $con->connect_error);
- }
- $sql = "SELECT * FROM aufgabe02.employee";
- $result = $con->query($sql);
- if(!$result)
- {
- echo "Error: ". $con->error;
- }
- if ($result->num_rows > 0)
- {
- while ($row = $result->fetch_assoc())
- {
- $option = $row["id"] . " " . $row["forename"] . " " . $row["name"] . " " . $row["city"];
- echo "<option>" . $option . "</option>";
- }
- }
- else{
- echo "<option>LEER</option>";
- }
- $con->close();
- }
- function AddUser($id, $forename, $name, $city)
- {
- global $con;
- if($con->connect_error)
- {
- die("Connection Problem: ". $con->connect_error);
- }
- echo $forename;
- }
- if(isset($_POST['sent']))
- {
- echo "moin";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement