Php tablo düzgün listeleme
3
●667
- 21-01-2019, 21:44:37Hocam Pm İle Ulaşın Hemen Ufak Sorununuzu Gösterip Sorunu Çözelim.
Ek Olarak Burdan Da Yazıyım Başkalarıda Faydalansın.
<html> <head> <style> #customers { font-family: "Trebuchet MS", Arial, Helvetica, sans-serif; border-collapse: collapse; width: 100%; } #customers td, #customers th { border: 1px solid #ddd; padding: 8px; } #customers tr:nth-child(even){background-color: #f2f2f2;} #customers tr:hover {background-color: #ddd;} #customers th { padding-top: 12px; padding-bottom: 12px; text-align: left; background-color: #4CAF50; color: white; } </style> </head> <body> <table id="customers"> <tr> <th>ID</th> <th>BAYI</th> <th>SERVIS</th> <th>URUN</th> <th>FİYAT</th> <th>EKLENDİĞİ TARİH</th> </tr> <?php $conn = mysqli_connect("localhost", "v_ku_adi", "v_sifre", "v_adi"); if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } $sql = "SELECT id,bayi, servis,urun,fiyat, eklenen_tarih FROM urunler"; $result = $conn->query($sql); if ($result->num_rows > 0) { while($row = $result->fetch_assoc()) { echo ' <tr> <td>. $row["id"] .</td> <td>. $row["bayi"] .</td> <td>. $row["servis"] .</td> <td>. $row["urun"] .</td> <td>. $row["fiyat"] .</td> <td>. $row["eklenen_tarih"].</td> </tr> '; } } else { echo " Kayıt Yok !"; } $conn->close(); ?> </table> </body> </html> - 21-01-2019, 23:13:20