daily pastebin goal
14%
SHARE
TWEET

Untitled

a guest Jan 20th, 2017 93 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3.   $host = "localhost";
  4.   $user = "root";
  5.   $pass = "root123";
  6.   $db = "biblioteka";
  7.   $connection = @new mysqli($host, $user, $pass, $db);
  8.   if (mysqli_connect_errno() != 0)
  9.   {
  10.     echo '<p>Błąd połaczęnia z bazą' . mysqli_connect_error();
  11.   }
  12.   else
  13.   {
  14.     $wynik = $connection -> query('SELECT * FROM autorzy');
  15.     if ($wynik == false)
  16.     {
  17.       echo '<p>Zapytanie nie zostało wykonane porpawnie!</p>';
  18.  
  19.       $connection -> close();
  20.     }
  21.    
  22.     echo "<table>";
  23.     echo '<tr>';
  24.      echo '<th>Imie</th>';
  25.      echo '<th>Nazwisko</th>';
  26.     echo '</tr>';
  27.     else($wynik->num_rows >0)
  28.     {
  29.       while($row = $wynik->fetch_assoc())
  30.       {
  31.           echo "<tr>";
  32.             echo "<td>". $row['imie']."</td>";
  33.             echo "<td>". $row['nazwisko']."</td>";
  34.           echo "</tr>";
  35.  
  36.  
  37.       }
  38.     echo </table>;
  39.       $connection -> close();
  40.     }
  41.   }
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top