Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $dbhost = 'localhost';
- $dbuser = 'root';
- $dbpass = '';
- $koneksi = mysql_connect($dbhost, $dbuser, $dbpass);
- if(! $koneksi )
- {
- die('Gagal Koneksi: ' . mysql_error());
- }
- $sql = 'SELECT nama, username, ttl, email, bayar FROM pencari_kerja';
- mysql_select_db('loker');
- $ambildata = mysql_query( $sql, $koneksi);
- if(! $ambildata )
- {
- die('Gagal ambil data: ' . mysql_error());
- }
- ?>
- <!DOCTYPE html>
- <head>
- <meta charset="UTF-8">
- <title>Belajar PHP MySQL</title>
- <style>
- h3{
- text-align:center; }
- table {
- border-collapse:collapse;
- border-spacing:0;
- font-family:Arial, sans-serif;
- font-size:16px;
- padding-left:300px;
- margin:auto; }
- table th {
- font-weight:bold;
- padding:10px;
- color:#fff;
- background-color:#2A72BA;
- border-top:1px black solid;
- border-bottom:1px black solid;}
- table td {
- padding:10px;
- border-top:1px black solid;
- border-bottom:1px black solid;
- text-align:center; }
- tr:nth-child(even) {
- background-color: #DFEBF8; }
- </style>
- </head>
- <body>
- <table>
- <tr>
- <th>Nama</th>
- <th>Username</th>
- <th>TTL</th>
- <th>Email</th>
- <th>Bayar</th>
- <th>Acc</th>
- </tr>
- <?php
- while($row = mysql_fetch_array($ambildata, MYSQL_ASSOC))
- {
- echo "<tr>";
- echo "<td>".$row['nama']."</td>";
- echo "<td>".$row['username']."</td>";
- echo "<td>".$row['ttl']."</td>";
- echo "<td>".$row['email']."</td>";
- echo "<td>".$row['bayar']."</td>";
- echo "<td><input type='checkbox' name='vehicle' value='Bike'>I have a bike</td>";
- echo "</tr>"; }
- mysql_close($koneksi);
- ?>
- </table>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement