Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <body>
- <?php
- $host = "";
- $user = "";
- $pass = "";
- $polaczenie = mysql_connect($host, $user, $pass);
- if(!$polaczenie )
- {
- die('Blad polaczenia: '.mysql_error());
- }
- echo 'polaczenie udane<br>';
- mysql_select_db( 'nazwa bazydanych' );
- ?>
- kod html
- <?php
- ////funkcje dodawania i usuwania z bazy danych informacji
- ///
- ///
- ///
- //wyswietlanie danych
- $polecenie = "SELECT * FROM dane";//WHERE
- $wyslij = mysql_query( $polecenie, $polaczenie );
- if(!$wyslij)
- {
- die('Nie mozna pobrac danych: '.mysql_error());
- }
- while($wiersz = mysql_fetch_array($wyslij, MYSQL_ASSOC))
- {
- echo $wiersz['id']." ".$wiersz['imie']." ".$wiersz['nazwisko'].
- "<br>--------------------------------<br>";
- }
- mysql_close($polaczenie);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement