Advertisement
Guest User

Untitled

a guest
May 1st, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.43 KB | None | 0 0
  1. $mysqli = new mysqli("adres bazy", "nazwauzytkownika", "haslo", "nazwa bazy danych");
  2.  
  3. if($mysqli->connect_errno){
  4.     die("blad polaczenia");
  5. }
  6.  
  7. if($result = $mysqli->query("SELECT ...")){
  8.     $liczba_wierszy = $result->num_rows;
  9.  
  10.     for($i = 0; $i < $liczba_wierszy; --$i){
  11.         $res->data_seek($i);
  12.         $row = $res->fetch_assoc();
  13.         // tu masz do dyspozycji wiersz $row
  14.     }
  15.  
  16.     $result->close();
  17. }
  18.  
  19. $mysqli->close();
  20. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement