Mohon dibantu, ada yang bisa memperbaiki script saya ini. saya bermaksud untuk menampilkan kategori yang berelasi ditabel topik. tapi saya tidak tau script ya, saya sudah coba menggunakan beberapa script yang yang dapat tapi tidak berhasil juga.
<?php 
error_reporting(0);
include 'koneksi.php';
session_start();
?>
<!DOCTYPE html>
<html lang="en">
    
<head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title>Forum Diskusi</title>

        <!-- Bootstrap -->
        <link href="css/bootstrap.min.css" rel="stylesheet">

        <!-- Custom -->
        <link href="css/custom.css" rel="stylesheet">

        <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
        <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
        <!--[if lt IE 9]>
          <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
          <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
          <![endif]-->

        <!-- fonts -->
        <link href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'>
        <link rel="stylesheet" href="font-awesome-4.0.3/css/font-awesome.min.css">

        <!-- CSS STYLE-->
        <link rel="stylesheet" type="text/css" href="css/style.css" media="screen" />

        <!-- SLIDER REVOLUTION 4.x CSS SETTINGS -->
        <link rel="stylesheet" type="text/css" href="rs-plugin/css/settings.css" media="screen" />

    </head>
    <body>

        <div class="container-fluid">
        <?php include 'header.php'; ?>
          <section class="content">
                <div class="container">
                    <br>
                </div>

                <div class="container">

				<div class="row">
                        <div class="col-lg-8 col-md-8">
						
				<div class="post">
				<form action="aksi_tambah_diskusi.php" class="form newtopic" method="post">
					<div class="postinfotop">
						<h2>Tambah Diskusi</h2>
					</div>
					
					<!-- acc section -->
					<div class="accsection">
						<div class="acccap">
							<div class="userinfo pull-left">&nbsp;</div>
							<div class="clearfix"></div>
						</div>
						<div class="topwrap">
							<div class="userinfo pull-left"> </div>
							<div class="posttext pull-left">
							
								<div class="row">
									<div class="col-lg-4 col-md-6">
									 Topik
									</div>
								
								<div class="col-lg-8 col-md-6">
									<select name="topik" id="topik"  class="form-control" >
										<option value="" disabled selected>Pilih Topik</option>
										<?php
										$kueri_comt = mysql_query("select * from topik");
										while($comt = mysql_fetch_array($kueri_comt)){
										?>
										<option value="<?php echo $comt[id_topik] ?>"><?php echo $comt[judul_topik] ?></option>
										<?php }?>
									</select>
								</div>
								</div>
								
								<div class="row">
									<div class="col-lg-4 col-md-6">
									 Kategori
									</div>
								
								<div class="col-lg-8 col-md-6">
									<select name="kategori" id="kategori"  class="form-control" >
										<option value="" disabled selected>Pilih Kategori</option>
										<?php
										$kueri_comk = mysql_query("select * from kategori");
										while($comk = mysql_fetch_array($kueri_comk)){
										?>
										<option value="<?php echo $comk[id_kategori] ?>"><?php echo $comk[nama_kategori] ?></option>
										<?php }?>
									</select>
								</div>
								</div>
								
								<div class="row">
								<div class="col-lg-4 col-md-6">
									 Judul Diskusi
									</div>
									<div class="col-lg-8 col-md-6">
										<input type="text" name="judul" placeholder="judul_diskusi" class="form-control" />
									</div>
								</div>
								
								<div class="row">
									<div class="col-lg-4 col-md-6">
									Isi Diskusi
									</div>
									<div class="col-lg-8 col-md-6">
										<textarea type="text" placeholder="Isi Diskusi" class="form-control" id="textarea" name="isi" /></textarea>
									</div>
								</div>
								

							</div>
							<div class="clearfix"></div>
						</div>  
					</div><!-- acc section END -->
					<div class="postinfobot">

					<div class="notechbox pull-left">
					</div>

					<div class="pull-left lblfch">
					</div>

					<div class="pull-right postreply">
						<div class="pull-left"><button type="submit" class="btn btn-primary">Simpan</button></div>
						<div class="clearfix"></div>
					</div>
					<div class="clearfix"></div>
				</div>
					</form>
					</div>

						
		                </div>
                        <div class="col-lg-4 col-md-4">
                        <?php include 'sidebar.php' ?>

                           


                        </div>
                    </div>
                </div>


            </section>

            <?php include 'footer.php' ?>
        </div>

        <!-- get jQuery from the google apis -->
        <script type="text/javascript" src="js/jquery.js"></script>
 

        <!-- SLIDER REVOLUTION 4.x SCRIPTS  -->
        <script type="text/javascript" src="rs-plugin/js/jquery.themepunch.plugins.min.js"></script>
        <script type="text/javascript" src="rs-plugin/js/jquery.themepunch.revolution.min.js"></script>

        <script src="js/bootstrap.min.js"></script>


        <!-- LOOK THE DOCUMENTATION FOR MORE INFORMATIONS -->
        <script type="text/javascript">
            
            var revapi;

            jQuery(document).ready(function() {
                "use strict";
                revapi = jQuery('.tp-banner').revolution(
                        {
                            delay: 15000,
                            startwidth: 1200,
                            startheight: 278,
                            hideThumbs: 10,
                            fullWidth: "on"
                        });

            });	//ready

        </script>

        <!-- END REVOLUTION SLIDER -->
    </body>


</html>
Silahkan login untuk menjawab!
Mohon dibantu, saya meiliki script seperti dibawah ini. namun setelah di running index.php nya.
muncul error seperti ini. Mohon bisa dibetulkan kesalahan saya dimana?
" Warning: sqlsrv_fetch_array() expects parameter 1 to be resource, string given in D :\xampp\htdocs\testing2\index.php on line 98 "
<html>
<head>
<title>Maintenance Stock</title>
</head>
<body>
<?php
	ini_set('display_errors', 1);
	error_reporting(~0);

	$strKeyword = null;

	if(isset($_POST["txtKeyword"]))
	{
		$strKeyword = $_POST["txtKeyword"];
	}
	if(isset($_GET["txtKeyword"]))
	{
		$strKeyword = $_GET["txtKeyword"];
	}
?>
<form name="frmSearch" method="post" action="<?php echo $_SERVER['SCRIPT_NAME'];?>">
  <table width="599" border="1">
    <tr>
      <th>Keyword
      <input name="txtKeyword" type="text" id="txtKeyword" value="<?php echo $strKeyword;?>">
      <input type="submit" value="Search"></th>
    </tr>
  </table>
</form>
<?php
	$serverName = "localhost";
	$userName = "sa";
	$userPassword = "password";
	$dbName = "hpm";

	$connectionInfo = array("Database"=>$dbName, "UID"=>$userName, "PWD"=>$userPassword, "MultipleActiveResultSets"=>true);

	$conn = sqlsrv_connect( $serverName, $connectionInfo);

	if( $conn === false ) {
		die( print_r( sqlsrv_errors(), true));
	}

	$stmt = "SELECT * FROM mdk_datakendaraan WHERE norangka LIKE '%".$strKeyword."%' ";
	
	$params = array();
	$options =  array( "Scrollable" => SQLSRV_CURSOR_KEYSET );
	$query = sqlsrv_query( $conn, $stmt , $params, $options );

	$num_rows = sqlsrv_num_rows($query);

	$per_page = 20;   // Per Page
	$page  = 1;
	
	if(isset($_GET["Page"]))
	{
		$page = $_GET["Page"];
	}

	$prev_page = $page-1;
	$next_page = $page+1;

	$row_start = (($per_page*$page)-$per_page);
	if($num_rows<=$per_page)
	{
		$num_pages =1;
	}
	else if(($num_rows % $per_page)==0)
	{
		$num_pages =($num_rows/$per_page) ;
	}
	else
	{
		$num_pages =($num_rows/$per_page)+1;
		$num_pages = (int)$num_pages;
	}
	$row_end = $per_page * $page;
	if($row_end > $num_rows)
	{
		$row_end = $num_rows;
	}


	$stmt2 = " SELECT c.* FROM (SELECT ROW_NUMBER() OVER(ORDER BY norangka) AS RowID,*  FROM mdk_datakendaraan  WHERE norangka LIKE '%".$strKeyword."%') AS c	WHERE c.RowID > $row_start AND c.RowID <= $row_end";

	
?>
<table width="600" border="1">
  <tr>
    <th width="91"> <div align="center">Kode Tipe </div></th>
    <th width="98"> <div align="center">Nama </div></th>
    <th width="198"> <div align="center">No. Rangka </div></th>
    <th width="97"> <div align="center">No. Mesin </div></th>
    <th width="59"> <div align="center">Nama Sales </div></th>
    <th width="71"> <div align="center">Nama Running </div></th>
  </tr>
<?php
while($row = sqlsrv_fetch_array($stmt2))

{
?>
  	
<tr>
    <td><div align="center"><?php echo $row["kode_tipe"];?></div></td>
    <td><?php echo $row["nama"];?></td>
    <td><?php echo $row["norangka"];?></td>
    <td><div align="center"><?php echo $row["nomesin"];?></div></td>
    <td align="right"><?php echo $row["nama_sales_mdk"];?></td>
    <td align="right"><?php echo $row["nama_cust_mdk"];?></td>
  </tr>
<?php
}
?>
</table>
<br>
Total <?php echo $num_rows;?> Record : <?php echo $num_pages;?> Page :
<?php
if($prev_page)
{
	echo " <a href='$_SERVER[SCRIPT_NAME]?Page=$prev_page&txtKeyword=$strKeyword'><< Back</a> ";
}

for($i=1; $i<=$num_pages; $i++){
	if($i != $page)
	{
		echo "[ <a href='$_SERVER[SCRIPT_NAME]?Page=$i&txtKeyword=$strKeyword'>$i</a> ]";
	}
	else
	{
		echo "<b> $i </b>";
	}
}
if($page!=$num_pages)
{
	echo " <a href ='$_SERVER[SCRIPT_NAME]?Page=$next_page&txtKeyword=$strKeyword'>Next>></a> ";
}
sqlsrv_close($conn);
?>
</body>
</html>
Silahkan login untuk menjawab!

Mohon Bantuan

_FB_NAME_ · Nov 23, 2016
maaf gan, saya mau tanya, semisal saya punya tabel akun (id_akun (01,02), jenis_akun (pendapatan,pengeluaran), keterangan (kas desa,pembetulan jalan)).
di form saya punya 2 combobox, combobox 1 ada data: bukti bank masuk, bukti bank keluar (bukan data dinamis). semisal pada combobox 1 saya pilih bukti bank masuk, maka pada combobox 2 akan menampilkan data hanya berdasarkan jenis_akun pendapatan. jika combobox 1 saya pilih bukti bank keluar, maka pada combobox 2 hanya akan menampilkan data jenis_akun pengeluaran.
Moho bantuannya gan terima kasih
Silahkan login untuk menjawab!
cara sum total ke subtotal bagai mana caranya?
Silahkan login untuk menjawab!

cara menampilkan data

Anfaul · Nov 6, 2016
Saya mau tanya min.. say amu menampilkan data ke dalam menu admin tpi error kaya gini

Notice: Undefined variable: conn in C:\xampp\htdocs\Zakat\admin\mod-amil\dataamil.php on line 3

Fatal error: Call to a member function prepare() on a non-object in C:\xampp\htdocs\Zakat\admin\mod-amil\dataamil.php on line 3

ini min script.nya
<?php 
try{
  $queryamil = $conn->prepare("SELECT * FROM amil");
  $queryamil->execute();
  $rsamil=$queryamil->fetch(PDO::FETCH_ASSOC);
}
catch (PDOException $e) {
  echo $e->getMessage();
}
?>
<style type="text/css">
body,td,th {
  color: #000;
}
</style>

<h3>Data amil</h3>
<a href="?mod=mod-amil/simpanamil">+Tambah Data</a>
<table width="100%" border="1" cellpadding="5" cellspacing="0">
  <tr>
    <th>No</th>
    <th>Id Amil</th>
    <th>Nama Amil</th>
    <th>Alamat Amil</th>
    <th>Aksi</th>
  </tr>
  <?php $no=1; do{ ?>
  <tr>
    <td><?php echo $no++; ?></td>
    <td><?php echo $rsamil['id_amil']; ?></td>
    <td><?php echo $rsamil['nama_amil']; ?></td>
    <td><?php echo $rsamil['alamat_amil']; ?></td>
    <td><a href="?mod=mod-amil/detilamil&id_amil=<?php echo $rsamil['id_amil']; ?>">Detil |</a>
    <a href="?mod=mod-amil/editamil&id_amil=<?php echo $rsamil['id_amil']; ?>">Edit|</a>
    <a href="?mod=mod-amil/aksiamil&id_amil=<?php echo $rsamil['id_amil']; ?>&del=y" onClick="return confirm('Apakah anda mau menghapus data <?php echo addslashes ($rsamil['nama_amil']);?>?')" >Hapus|</a></td>
  </tr>
  <?php }while($rsamil=$queryamil->fetch(PDO::FETCH_ASSOC)); ?>
</table>
Silahkan login untuk menjawab!
Gan, Gimana Cara Menampilkan Data Terbesar Menggunakan Fungsi GREATEST, Tapi Yang Muncul bukan Valuesnya tetapi Nama Field nya. Thx
Silahkan login untuk menjawab!