Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function Polacz(){
- $nazwaserwera = "127.0.0.1";
- $user = 'root';
- $password = "";
- $b="galeria";
- $baza=new mysqli($nazwaserwera,$user,$password,$b);
- return $baza;
- if ($baza->connect_error)
- die("Błąd połączenia: ".$baza->connect_error);
- mysqli_set_charset($baza,"utf8") ;
- }
- ?>
- <!DOCTYPE html>
- <html lang="pl">
- <head>
- <meta charset="utf-8" />
- <style></style>
- <script></script>
- </head>
- <body>
- <?php
- $baza=Polacz();
- $query="SELECT adres FROM obraz";
- if($wynik=$baza->query($query, MYSQLI_STORE_RESULT)) {
- while(list($adres)=$wynik->fetch_row()) {
- echo "<img width='200px' height='200px' src='$adres'>$adres<br/>";
- }}
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement