Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $con=mysqli_connect("localhost","root","","aaaa");
- // Check connection
- if (mysqli_connect_errno())
- {
- echo "Failed to connect to MySQL: " . mysqli_connect_error();
- }
- // Perform a query, check for error
- //if (!mysqli_query($con,"INSERT INTO SALA (NUMER,PIETRO) VALUES ('12',123), (123,123)"))
- // {
- // echo("Error description: " . mysqli_error($con));
- // }
- $pyt = mysqli_query($con, "SELECT s.ID_SALI, s.NUMER, o.ID_UZYT, o.IMIE, o.NAZWISKO FROM sala s,uzytkownik u,jest_opiekunem op WHERE op.ID_SAL=s.ID_SALI AND op.ID_US=u.ID_UZYT");
- echo "<table>";
- echo "<tr><th>ID_SALI</th><th>NUMER SALI</th><th>ID_USER</th><th>IMIE</th><th>NAZWISKO</th></tr>";
- while ($tabl = mysqli_fetch_assoc($pyt)) {
- echo "<tr><td>{$tabl['ID_SALI']}</td><td>{$tabl['NUMER']}</td><td>{$tabl['ID_USER']}</td><td>{$tabl['IMIE']}</td><td>{$tabl['NAZWISKO']}</td></tr>";
- }
- echo "</table>";
- mysqli_close($con);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement