[code=php]
<?
session_start();
header(“Content-control: private”);
if($_SESSION[‘user’]==””)
include ‘dbase.php’;
$id = $_GET[‘id’];
$query = “SELECT * FROM stok WHERE id =’$id’ limit 1″;
$result = mysql_db_query($dbname,$query);
$namaproduk = mysql_result($result,0,”namaProduk”);
$hargaseunit = mysql_result($result,0,”hargaSeunit”);
$peratuskeuntungan = mysql_result($result,0,”peratusKeuntungan”);
$hargajualan = mysql_result($result,0,”hargaJualan”);
$bilstok = mysql_result($result,0,”bilStok”);
$tarikh = mysql_result($result,0,”tarikh”);
@mysql_free_result($result);
?>
<html>
<head>
<title>Terminal Computer Services :: Stok</title>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″>
</head>
<script type=”text/javascript”>
function CalcPercnt(val, f) {
//val: Percentage Field value
//f: form which percent1 is in
if (!val == “”){
f.hargajualan.value = (f.hargaseunit.value * (val / 100 + 1)).toFixed(2)
}
}
</script>
<body>
<form action=”updatestok.php” method=”POST”>
<table width=”87%” height=”292″ border=”0″ align=”center” bgcolor=”#000000″>
<tr>
<td width=”41%”><font color=”#FFFFFF”><h3>Nama Produk:</h3></font></td>
<td width=”29%”> <input name=”namaproduk” type=”text” size=”25″value=”<? echo $namaproduk;?>”></td>
</tr>
<tr>
<td width=”29%”><font color=”#FFFFFF”><h3>Harga seunit:</h3><td width=”71%”><input name=”hargaseunit” type=”text” size=”25″ value=”<? echo $hargaseunit;?>”></td>
</tr>
<tr>
<td width=”29%”><font color=”#FFFFFF”><h3>Peratus Keuntungan:</h3></td><td><select name=”peratuskeuntungan” onBlur=”CalcPercnt(this.value, this.form)” value= “<? echo $peratuskeuntungan;?>”>
<option>5</option>
<option>10</option>
<option>15</option>
<option>20</option>
<option>25</option>
<option>30</option>
</select></td>
</tr>
<tr>
<td width=”41%”><font color=”#FFFFFF”><h3>Harga Jualan:</h3><td width=”30%”><input name=”hargajualan” type=”text” size=”25″ value=”<? echo $hargajualan;?>”></td>
</tr>
<tr><td width=”29%”><font color=”#FFFFFF”>
<h3>Bil Stok:</h3></font></td>
<td width=”71%”><input name=”bilstok” type=”text” size=”25″ value=”<? echo $bilstok;?>”></td>
</tr>
<td><font color=”#FFFFFF”><h3>Tarikh<em>(dd/mm/yy)</em>:</h3></font></td><td>
<input name=”tarikh” type=”text” size=”25″ value=”<? echo $tarikh;?>”></td>
<input type=”hidden” name=”id” id=”id” value=”<? echo $id; ?>”></td>
</tr>
<tr> <br><br><br>
</table>
<td>
<br><br><br>
<input type=”submit” name=”Submit” value=”Ubah”>
<input type=”reset” name=”Submit2″ value=”Reset”>
</td>
</form>
</body>
</html>
WHEN I RUN THIS CODE,I GOT THIS MESSAGE::I HOPE SOMEONE CAN HELP ME TO SOLVE THIS PROBLEM.
Warning: Unable to jump to row 0 on MySQL result index 2 in c:phpdevwwwtcsubahstok.php on line 12
Warning: Unable to jump to row 0 on MySQL result index 2 in c:phpdevwwwtcsubahstok.php on line 13
Warning: Unable to jump to row 0 on MySQL result index 2 in c:phpdevwwwtcsubahstok.php on line 14
Warning: Unable to jump to row 0 on MySQL result index 2 in c:phpdevwwwtcsubahstok.php on line 15
Warning: Unable to jump to row 0 on MySQL result index 2 in c:phpdevwwwtcsubahstok.php on line 16
Warning: Unable to jump to row 0 on MySQL result index 2 in c:phpdevwwwtcsubahstok.php on line 17