left join.

kak mau nanya sintax mana yah yang salah pada souce code ini.


<html lang="en">
  <head>
	<?php include("includes/fungsi.php");?>
    <?php include ('kerangka.php');?>
	<?php include ('koneksi.php');?>
    <title>CCAN</title>

    <!-- Bootstrap -->
    <link href="../vendors/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- Font Awesome -->
    <link href="../vendors/font-awesome/css/font-awesome.min.css" rel="stylesheet">
    <!-- NProgress -->
    <link href="../vendors/nprogress/nprogress.css" rel="stylesheet">
    <!-- iCheck -->
   <link href="../vendors/iCheck/skins/flat/green.css" rel="stylesheet">

    <!-- Custom Theme Style -->
    <link href="../build/css/custom.min.css" rel="stylesheet">
  </head>

  <body class="nav-md">
    <div class="container body">

        <!-- page content -->
        <div class="right_col" role="main">
          <div class="">
            <div class="page-title">
              <div class="title_left">
                <h3>Tabel proyek</h3>
              </div>

              <div class="title_right">
                <div class="col-md-5 col-sm-5 col-xs-20 form-group pull-right top_search">
                  <div class="input-group">
                    <input type="text" class="form-control" placeholder="Search for...">
                    <span class="input-group-btn">
                      <button class="btn btn-default" type="button">Go!</button>
                    </span>
                  </div>
                </div>
              </div>
            </div>

            <div class="clearfix"></div>

            <div class="row">

              <div class="clearfix"></div>

              <div class="col-md-20 col-sm-20 col-xs-20">
                <div class="x_panel">
                  <div class="x_title">
					<a class="fa fa-plus btn btn-info" href="proyek_tambah.php">
						<i class="icon-on-right"></i>
					</a>
                    <ul class="nav navbar-right panel_toolbox">
                      <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
                      </li>

                      <li><a class="close-link"><i class="fa fa-close"></i></a>
                      </li>
                    </ul>
                    <div class="clearfix"></div>
                  </div>
                  <div class="x_content">
                    <table class="table table-bordered">
                      <thead>
					<tr>
						<th style="text-align:center">No</th>
						<th>Gambar </th>
						<th>Kode Proyek </th>
						<th style="text-align:center">Divisi</th>
						<th style="text-align:center">Witel</th>
						<th style="text-align:center">Site ID</th>
						<th>Nama PJ</th>
						<th>Nama Proyek</th>
						<th style="text-align:center">Lokasi</th>
						<th style="text-align:center">Garis Bujur</th>
						<th style="text-align:center">Garis Lintang</th>
						<th style="text-align:center">Order</th>
						<th style="text-align:center">Type</th>
						<th style="text-align:center">Result</th>
						<th style="text-align:center">Mulai Proyek</th>
						<th style="text-align:center">Target Proyek</th>
						<th style="text-align:center">Mitra</th>
						<th style="text-align:center">Jumlah Team</th>
						<th style="text-align:center">Survey</th>
						<th style="text-align:center">Instalasi FTTH</th>
						<th style="text-align:center">Proses</th>
						<th style="text-align:center">CT / UT</th>
						<th style="text-align:center">Rekon</th>
						<th style="text-align:center">Presentasi</th>
						<th style="text-align:center">Kendala</th>
						<th style="text-align:center">Keterangan</th>
						<th style="text-align:center">Action</th>

					</tr>
				</thead>
				<tbody>
				                               <?php
                                    //iclude file koneksi ke database
                                    include('koneksi.php');


									$query = mysql_query("SELECT proyek.id_proyek, proyek.kode, divisi.id_divis, witel.id_witel, proyek.nama_pj, proyek.nama_proyek, proyek.lokasi,
									proyek.garis_bujur, proyek.garis_lintang, order.id_order, type.id_type, proyek.mulai_proyek, proyek.target_proyek, proyek.mitra, proyek.jumlah_team,
									proyek.survey, proyek.instalasi_ftth, proses_kemajuan.id_proses, proyek.ct_ut, proyek.rekon, proyek.persentasi, proyek.kendala, proyek.keterangan, proyek.gambar_proyek
									FROM proyek
									LEFT JOIN divisi ON proyek.id_divisi = divisi.id_divisi
									LEFT JOIN witel ON proyek.id_witel = witel.id_witel
									LEFT JOIN order ON proyek.id_order = order.id_order
									LEFT JOIN type ON proyek.id_type = type.id_type
									LEFT JOIN proses_kemajuan ON proyek.id_proses = proses_kemajuan.id_proses")or die(mysql_error());

                                    $no = 0;    //membuat variabel $no untuk membuat nomor urut
                                    while($data = mysql_fetch_assoc($query)){
                                    $no++;
                                    $id_proyek = $data['id_proyek'];
									$kode = $data['kode'];
									$id_divisi = $data['id_divisi'];
									$id_witel = $data['id_witel'];
									$nama_pj = $data['nama_pj'];
									$nama_proyek = $data['nama_proyek'];
									$lokasi = $data['lokasi'];
									$garis_bujur = $data['garis_bujur'];
									$garis_lintang = $data['garis_lintang'];
									$id_order = $data['id_order'];
									$id_type = $data['id_type'];
									$result = $data['result'];
									$mulai_proyek = $data['mulai_proyek'];
									$target_proyek = $data['target_proyek'];
									$mitra = $data['mitra'];
									$jumlah_team = $data['jumlah_team'];
									$survey = $data['survey'];
									$instalasi_ffth = $data['instalasi_ffth'];
									$id_proses = $data['id_proses'];
									$ct_ut = $data['ct_ut'];
									$rekon = $data['rekon'];
									$persentasi = $data['persentasi'];
									$kendala = $data['kendala'];
									$keterangan = $data['keterangan'];
                                ?>
                                    <tr>
                                        <td width="50"><?php echo $no; ?></td>
										<td><img src="gambar/<?php echo $data['gambar_proyek']; ?>" style="max-width:70px;"/></a></td>
                                        <td><?php echo  $data['kode']; ?></td>
										<td><?php echo  $data['id_divisi']; ?></td>
										<td><?php echo  $data['id_witel']; ?></td>
										<td><?php echo  $data['nama_pj']; ?></td>
										<td><?php echo  $data['nama_proyek']; ?></td>
										<td><?php echo  $data['lokasi']; ?></td>
										<td><?php echo  $data['garis_bujur']; ?></td>
										<td><?php echo  $data['garis_lintang']; ?></td>
										<td><?php echo  $data['id_order']; ?></td>
										<td><?php echo  $data['id_type']; ?></td>
										<td><?php echo  $data['result']; ?></td>
										<td><?php echo  $data['mulai_proyek']; ?></td>
										<td><?php echo  $data['target_proyek']; ?></td>
										<td><?php echo  $data['mitq']; ?></td>
										<td><?php echo  $data['jumlq']; ?></td>
										<td><?php echo  $data['survey']; ?></td>
										<td><?php echo  $data['instalasi_ffth']; ?></td>
										<td><?php echo  $data['id_proses']; ?></td>
										<td><?php echo  $data['ct_ut']; ?></td>
										<td><?php echo  $data['rekon']; ?></td>
										<td><?php echo  $data['persentasi']; ?></td>
										<td><?php echo  $data['kendala']; ?></td>
										<td><?php echo  $data['keterangan']; ?></td>


										<td width="130">

                                            <a href="edit_proyek.php<?php echo '?id_proyek=' . $id_proyek; ?>"><span class="fa fa-edit btn btn-success"></span></a>

                                            <a href="#delete_product<?php echo $id_proyek; ?>" role="button"  data-target = "#delete_product<?php echo $id_proyek;?>"data-toggle="modal"><span class="fa fa-trash-o btn btn-danger"></span></a>


											<a href="download.php?id=<?php echo $row['id_proyek'] ?>">Download</a>
                                            </td>

                                            <?php include ('modal_delete_proyek.php');?>

                                    </tr>
                                    <?php } ?>
				</tbody>
                    </table>

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

              <div class="clearfix"></div>
            </div>
          </div>
        </div>
        <!-- /page content -->

        <!-- footer content -->
        <?php include ('footer.html');?>
        <!-- /footer content -->
    </div>

    <!-- jQuery -->
    <script src="../vendors/jquery/dist/jquery.min.js"></script>
    <!-- Bootstrap -->
    <script src="../vendors/bootstrap/dist/js/bootstrap.min.js"></script>
    <!-- FastClick -->
    <script src="../vendors/fastclick/lib/fastclick.js"></script>
    <!-- NProgress -->
    <script src="../vendors/nprogress/nprogress.js"></script>
    <!-- iCheck -->
    <script src="../vendors/iCheck/icheck.min.js"></script>

    <!-- Custom Theme Scripts -->
    <script src="../build/js/custom.min.js"></script>
  </body>
</html>

hasil :

avatar lastriani
@lastriani

28 Kontribusi 0 Poin

Diperbarui 6 tahun yang lalu

8 Jawaban:

penggunaan tag

<?php include("includes/fungsi.php");?>
<?php include ('kerangka.php');?>
<?php include ('koneksi.php');?>

harus sebelum dari tag <head></head> seperti ini contohnya

<?php include("includes/fungsi.php");?>
<?php include ('kerangka.php');?>
<?php include ('koneksi.php');?>
<!doctype html>
<html>
<head>
   <title>Contoh</title>
</head>
</html>

tolong juga ganti judul sesuai isi agar yg lain bisa membantu.

avatar sptndc
@sptndc

247 Kontribusi 59 Poin

Dipost 6 tahun yang lalu

ngga ada ngaruhnya kak di taruh sebelum tag html atau di dalam head. hasilnya tetap seperti itu salahnya.

avatar lastriani
@lastriani

28 Kontribusi 0 Poin

Dipost 6 tahun yang lalu

pemanggilannya seperti ini

<?php
include ('includes/fungsi.php');
include ('kerangka.php');
include ('koneksi.php');
?>

avatar sptndc
@sptndc

247 Kontribusi 59 Poin

Dipost 6 tahun yang lalu

sudah kak. tapi salahnya malah tetap juga kyak gini..

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order ON proyek.id_order = order.id_order LEFT JOIN type ON proyek.id_t' at line 7

avatar lastriani
@lastriani

28 Kontribusi 0 Poin

Dipost 6 tahun yang lalu

kenapa include koneksi.php nya 2 kali ?

avatar sptndc
@sptndc

247 Kontribusi 59 Poin

Dipost 6 tahun yang lalu

Jawaban Terpilih

pada query "SELECT" nya gaada proyek.id_order dan proyek.id_type

avatar sptndc
@sptndc

247 Kontribusi 59 Poin

Dipost 6 tahun yang lalu

sudah bisa muncul kak.. terimakasih kak :D

avatar lastriani
@lastriani

28 Kontribusi 0 Poin

Dipost 6 tahun yang lalu

sama-sama, tandai jika sudah terjawab.

avatar sptndc
@sptndc

247 Kontribusi 59 Poin

Dipost 6 tahun yang lalu

Login untuk ikut Jawaban