Advertisement
Guest User

Untitled

a guest
May 20th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.78 KB | None | 0 0
  1. <?php
  2.  
  3.  $id_pol = mysql_connect('127.0.0.1', 'ka40779', 'Ka40779');
  4.            
  5.             if($id_pol)
  6.             {
  7.                 $id_baza = mysql_select_db('aleksandrakrawiec');
  8.                 if($id_baza)
  9.                 {
  10.                     $tekst = "SELECT * FROM tabela";
  11.                     $id_zap = mysql_query($tekst);
  12.                     if($id_zap)
  13.                     {
  14.                         echo '<table>
  15.                                <tr><th>ID
  16.                                </th><th>Imię
  17.                                </th><th>Nazwisko
  18.                                </th><th>Płeć
  19.                                </th><th>Naz. pan.
  20.                                </th><th>Email
  21.                                </th><th>Kod
  22.                                </th></tr>';
  23.  
  24.                         while($wiersz = mysql_fetch_array($id_zap))
  25.                         {
  26.                             echo '<tr><td>'.$wiersz['id'].
  27.                                 '</td><td>'.$wiersz['imie'].
  28.                                 '</td><td>'.$wiersz['nazwisko'].
  29.                                 '</td><td>'.$wiersz['plec'].
  30.                                 '</td><td>'.$wiersz['nazwisko_panienskie'].
  31.                                 '</td><td>'.$wiersz['email'].
  32.                                 '</td><td>'.$wiersz['kod_pocztowy'].
  33.                                 '</td></tr>';
  34.                         }
  35.                         echo '</table>';
  36.                     }
  37.  
  38.  
  39.  
  40.                     else
  41.                         echo 'kom3'.mysql_error();
  42.                 }
  43.                 else
  44.                     echo 'kom2'.mysql_error();
  45.                 mysql_close($id_pol);
  46.             }
  47.             else
  48.                 echo 'kom3'.mysql_error();
  49.  
  50.  
  51. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement