Wednesday, February 20, 2019

Web 2-2

Aplikasi 1
Buatlah file dengan nama 1krs.php
Copy-paste script berikut ini:
<?php
$conn = mysql_connect("localhost","root","");
mysql_select_db("stmikj2",$conn);
$sql = "select * from 1mhs p inner join 1krs b on p.nim=b.nim";
$result = mysql_query($sql);
?>
<table cellpadding="5" cellspacing="0" border="1">
<tr>
<th>NIM</th>
<th>Mahasiswa</th>
<th>KDMK</th>
</tr>
<?php while($buku = mysql_fetch_array($result)){?>
<tr>
<td><?php echo $buku['nim'];?></td>
<td><?php echo $buku['nama'];?></td>
<td><?php echo $buku['kdmk'];?></td>
</tr>
<?php }?>
</table>

**
Silakan buat dua tabel di database sesuai skrip di atas!
Sampai di sini, program sudah bisa dijalankan di browser, yakni data dari mysql sudah bisa tampil di Chrome atau Firefox.
========

Aplikasi 2
Buatlah file dengan nama 2jurusan.php
Copy-paste script berikut ini:
<?php
$conn = mysql_connect("localhost","root","");
mysql_select_db("stmikj2",$conn);
$sql = "select * from 1mhs p inner join 2jurusan b on p.nim=b.nim";
$result = mysql_query($sql);
?>
<table cellpadding="5" cellspacing="0" border="1">
<tr>
<th>NIM</th>
<th>Mahasiswa</th>
<th>Kode Jurusan</th>
</tr>
<?php while($buku = mysql_fetch_array($result)){?>
<tr>
<td><?php echo $buku['nim'];?></td>
<td><?php echo $buku['nama'];?></td>
<td><?php echo $buku['kdj'];?></td>
</tr>
<?php }?>
</table>
**
Silakan buat dua tabel di database sesuai skrip di atas!
Sampai di sini, program sudah bisa dijalankan di browser, yakni data dari mysql sudah bisa tampil di Chrome atau Firefox.
Bitcoin Offers:
Free Bitcoin, Double Bitcoin, Bitcoin Investment, Bitcoin Trading



"Bitcoin and Forex are high risk business. We must join them smartly."

No comments:

Post a Comment