Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $host= "localhost";
- $conn = mysqli_connect($host,"root","");
- if(!$conn) die("Nem lehet kapcsolódni!");
- $adatbazis="munkahely";
- mysqli_select_db($conn,"$adatbazis") or die("Nem lehet megnyitni az adatbázist!".mysql_error());
- $sql_query = "SELECT * FROM dolgozo";
- $sor=mysqli_query($conn,$sql_query,);
- print "<table border=1>";
- print "<tr>";
- for($i=0;$i<6;$i++)
- {
- print "<td>".$fieldName = mysqli_fetch_field_direct($sor, $i)->name;
- }
- while($row=mysqli_fetch_object($sor))
- {
- print "<tr>";
- foreach($row as $ertek)
- {
- print "<td> $ertek </td>";
- }
- print "</tr>";
- }
- print "</table>";
- mysqli_close($conn);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement