<?php require_once 'login.php'; $db_server = mysql_connect($db_hostname, $db_username, $db_password); if (!$db_server) { die("Unable to connect mysql_server"); } mysql_select_db($db_database) or die("Unable to select database" . mysql_error()); $query = "INSERT INTO cats Values(NULL,'Lion','Leo',4)"; $result = mysql_query($query); if (!$result) { die("Database access failed:" . mysq_error()); }
<fieldset> <legend>Tampil Data Senyawa</legend> <table width="100%" style="border: 1px solid #000; border-collapse: collapse;"> <tr style="background-color: #fc0;"> <th>Id</th> <th>Gambar</th> <th>Rumus</th> <th>Nama</th> <th>Keterangan </th> <th>Opsi</th> </tr> <?php $sql = mysql_query("select * fom senyawa") or die(mysq_error()); while ($data = mysql_fetch_array($sql)) { } ?> <tr> <td><?php echo $daata['Id']; ?> </td> <td><?php echo $daata['Gambar']; ?> </td> <td><?php echo $daata['Rumus']; ?> </td>
<br> <br> <table border="1" color="black" width="20%"> <tr bgcolor="lightgreen"><td><?php loc('bat_chg_percent'); ?> </td><td><?php loc('bat_v_el'); ?> </td></tr> <?php $result = mysql_query("SELECT * FROM work_table") or die(mysq_error()); for ($i = 0; $row[$i] = mysql_fetch_array($result); $i++) { echo "<tr><td>" . $row[$i][0] . "</td><td>" . $row[$i][1] . "</td></tr>"; } // array_pop($array); mysql_free_result($result); mysql_close($db); ?> </table> <br><br> <input TYPE="button" style="font-weight:bolder; background-color:darkkhaki;" VALUE=" <?php loc('MENU'); ?> " ONCLICK="HomeButton()">