Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>Afisare</title>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- </head>
- <body>
- <center>
- <h2>
- <a href="http://localhost/lab3/meniu.htm">Revenire la meniu</a>
- </h2>
- </center>
- </body>
- <?php
- mysql_connect("localhost", "root", "") or die ("Nu se poate conecta la serverul MySQL");
- mysql_select_db("facultate") or die ("Nu se poate selecta baza de date");
- $query = mysql_query("select * from studenti_ac");
- $nr_inregistrari = mysql_num_rows($query);
- if($nr_inregistrari == 0)
- {
- echo "<center>"."Baza de date este goala."."br"."</center";
- }
- else
- {
- echo "<center>"."Studentii din baza de date sunt:"."<br>"."</center";
- echo "<tr>";
- //cap de tabel
- echo "<table border='2' align='center'>";
- echo "<tr bgcolor='silver'>";
- echo "<th>Marca</th>";
- echo "<th>Nume</th>";
- echo "<th>Prenume</th>";
- echo "<th>An Studiu</th>";
- echo "</tr>";
- //valorile efective
- while($row = mysql_fetch_row($query))
- {
- echo "<tr>";
- foreach ($row as $value)
- echo "<td>$value</td>";
- echo "</tr>";
- }
- }
- ?>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement