mysql sorguda hata nerede

Kodla Büyü

dokmeefrail

Süper Üye
Süper Üye
Mesajlar
1,802
Kod:
$query_konu2 = "SELECT * FROM plan WHERE plan.hafta_no = $hafta AND plan.ogrenci_meslek = $row_ogrenciler2['ogrenci_meslek'] AND plan.ogrenci_sinif = $row_ogrenciler2['ogrenci_sinif'] AND plan.ogrenci_donem = $row_ogrenciler2['ogrenci_donem'] ";
 
Yukarda bu bu verinin sorgusunu yaptırdın mı?
$row_ogrenciler2['ogrenci_meslek']
yapmadıysan sorun bundan kaynaklanıyordur. İstersen sayfada kullandığın tüm kodları ekle sorunu görmek daha kolay olur.

Birde kodda parantez açıp kapamayı unutmuşsun.
şöyle olmalı:

Kod:
$query_konu2 = ("SELECT * FROM plan WHERE plan.hafta_no = $hafta AND plan.ogrenci_meslek = $row_ogrenciler2['ogrenci_meslek'] AND plan.ogrenci_sinif = $row_ogrenciler2['ogrenci_sinif'] AND plan.ogrenci_donem = $row_ogrenciler2['ogrenci_donem'] ");
 
Kod:
$query_konu2 = "SELECT * FROM plan WHERE plan.hafta_no = $hafta AND plan.ogrenci_meslek = '$row_ogrenciler2['ogrenci_meslek']' AND plan.ogrenci_sinif = $row_ogrenciler2['ogrenci_sinif'] AND plan.ogrenci_donem = $row_ogrenciler2['ogrenci_donem'] ";
Metinsel ifadelerin değerleri tırnak içerisine alınır. ogrenci_meslek alanı eğer metinselse yazdığım gibi tırnak içerisine almalısınız. Eğer diğer alanlardan da metinsel olanlar varsa onları da aynı mantıkla tırnak içerisine almalısınız.
 
Kod:
<?php require_once('Connections/gorev.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}

$colname_isveren1 = "-1";
if (isset($_GET['isyeri_no1'])) {
  $colname_isveren1 = $_GET['isyeri_no1'];
}
mysql_select_db($database_gorev, $gorev);
$query_isveren1 = sprintf("SELECT * FROM isyerleri WHERE isyeri_no = %s", GetSQLValueString($colname_isveren1, "int"));
$isveren1 = mysql_query($query_isveren1, $gorev) or die(mysql_error());
$row_isveren1 = mysql_fetch_assoc($isveren1);
$totalRows_isveren1 = mysql_num_rows($isveren1);

$colname_isveren2 = "-1";
if (isset($_GET['isyeri_no2'])) {
  $colname_isveren2 = $_GET['isyeri_no2'];
}
mysql_select_db($database_gorev, $gorev);
$query_isveren2 = sprintf("SELECT * FROM isyerleri WHERE isyeri_no = %s", GetSQLValueString($colname_isveren2, "int"));
$isveren2 = mysql_query($query_isveren2, $gorev) or die(mysql_error());
$row_isveren2 = mysql_fetch_assoc($isveren2);
$totalRows_isveren2 = mysql_num_rows($isveren2);

$colname_ogrenciler1 = "-1";
if (isset($_GET['isyeri_no1'])) {
  $colname_ogrenciler1 = $_GET['isyeri_no1'];
}
mysql_select_db($database_gorev, $gorev);
$query_ogrenciler1 = sprintf("SELECT * FROM ogrenciler WHERE isyeri_no = %s", GetSQLValueString($colname_ogrenciler1, "int"));
$ogrenciler1 = mysql_query($query_ogrenciler1, $gorev) or die(mysql_error());
$row_ogrenciler1 = mysql_fetch_assoc($ogrenciler1);
$totalRows_ogrenciler1 = mysql_num_rows($ogrenciler1);

$colname_ogrenciler2 = "-1";
if (isset($_GET['isyeri_no2'])) {
  $colname_ogrenciler2 = $_GET['isyeri_no2'];
}
mysql_select_db($database_gorev, $gorev);
$query_ogrenciler2 = sprintf("SELECT * FROM ogrenciler WHERE isyeri_no = %s", GetSQLValueString($colname_ogrenciler2, "int"));
$ogrenciler2 = mysql_query($query_ogrenciler2, $gorev) or die(mysql_error());
$row_ogrenciler2 = mysql_fetch_assoc($ogrenciler2);
$totalRows_ogrenciler2 = mysql_num_rows($ogrenciler2);
$hafta = $_GET['hafta']
mysql_select_db($database_gorev, $gorev);
$query_konu = "SELECT * FROM plan  WHERE plan.hafta_no = $hafta AND plan.ogrenci_meslek = $row_ogrenciler1['ogrenci_meslek'] AND plan.ogrenci_sinif = $row_ogrenciler1['ogrenci_sinif'] AND plan.ogrenci_donem = $row_ogrenciler1['ogrenci_donem']  ";
$konu = mysql_query($query_konu, $gorev) or die(mysql_error());
$row_konu = mysql_fetch_assoc($konu);
$totalRows_konu = mysql_num_rows($konu);

mysql_select_db($database_gorev, $gorev);
$query_konu2 = "SELECT * FROM plan WHERE plan.hafta_no = $hafta AND plan.ogrenci_meslek = $row_ogrenciler2['ogrenci_meslek'] AND plan.ogrenci_sinif = $row_ogrenciler2['ogrenci_sinif'] AND plan.ogrenci_donem = $row_ogrenciler2['ogrenci_donem'] ";
$konu2 = mysql_query($query_konu2, $gorev) or die(mysql_error());
$row_konu2 = mysql_fetch_assoc($konu2);
$totalRows_konu2 = mysql_num_rows($konu2);
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<table cellspacing="0" cellpadding="0">
  <col width="10" />
  <col width="17" />
  <col width="7" />
  <col width="26" span="6" />
  <col width="14" />
  <col width="60" />
  <col width="10" />
  <col width="16" />
  <col width="8" />
  <col width="19" />
  <col width="26" />
  <col width="9" />
  <col width="45" />
  <col width="16" />
  <col width="47" span="2" />
  <col width="40" />
  <col width="8" />
  <col width="18" />
  <col width="7" />
  <col width="26" span="6" />
  <col width="55" />
  <col width="6" />
  <col width="16" />
  <col width="6" />
  <col width="18" />
  <col width="26" />
  <col width="14" />
  <col width="35" />
  <col width="18" />
  <col width="47" span="2" />
  <col width="30" />
  <tr height="17">
    <td colspan="43" height="17"><div align="center">EREĞLİ  MESLEKİ EĞİTİM    MERKEZİ MÜDÜRLÜĞÜ</div></td>
  </tr>
  <tr height="18">
    <td colspan="43" height="18"><div align="center">ÇIRAK ÖĞRENCİLER İÇİN ÖĞRETMEN GÖREV FORMU</div></td>
  </tr>
  <tr height="17">
    <td colspan="5" rowspan="3" height="48">İş Yerinin</td>
    <td colspan="3">Meslek    Alanı</td>
    <td colspan="14">&nbsp;</td>
    <td colspan="5" rowspan="3">İş Yerinin</td>
    <td colspan="3">Meslek    Alanı</td>
    <td colspan="13">&nbsp;</td>
  </tr>
  <tr height="16">
    <td colspan="3" height="16">Adresi</td>
    <td colspan="14"><?php echo $row_isveren1['isyeri_adres']; ?></td>
    <td colspan="3">Adresi</td>
    <td colspan="13"><?php echo $row_isveren2['isyeri_adres']; ?></td>
  </tr>
  <tr height="15">
    <td colspan="3" height="15">Telefon    No </td>
    <td colspan="7">&nbsp;</td>
    <td colspan="3">Faks No</td>
    <td colspan="4">&nbsp;</td>
    <td colspan="3">Telefon No </td>
    <td colspan="6">&nbsp;</td>
    <td colspan="3">Faks No</td>
    <td colspan="4">&nbsp;</td>
  </tr>
  <tr height="15">
    <td colspan="22" height="15">İşverenin / Pratik Eğitimden Sorumlu Usta Öğreticinin</td>
    <td colspan="21">İşverenin    / Pratik Eğitimden Sorumlu Usta Öğreticinin</td>
  </tr>
  <tr height="15">
    <td colspan="5" height="15">Adı    Soyadı  :</td>
    <td colspan="6"><?php echo $row_isveren1['isyeri_ustaogretici']; ?></td>
    <td colspan="6" rowspan="2">İmza ve Kaşesi</td>
    <td colspan="5" rowspan="2">&nbsp;</td>
    <td colspan="5">Adı    Soyadı  :</td>
    <td colspan="5"><?php echo $row_isveren2['isyeri_ustaogretici']; ?></td>
    <td colspan="6" rowspan="2">İmza ve Kaşesi</td>
    <td colspan="5" rowspan="2">&nbsp;</td>
  </tr>
  <tr height="15">
    <td colspan="5" height="15">Unvanı         :</td>
    <td colspan="6">İşveren</td>
    <td colspan="5">Unvanı         :</td>
    <td colspan="5">işveren</td>
  </tr>
  <tr height="15">
    <td colspan="22" height="15">Öğrencinin</td>
    <td colspan="21">Öğrencinin</td>
  </tr>
  <tr height="15">
    <td colspan="11" height="15">Adı Soyadı</td>
    <td colspan="6">Sınıfı</td>
    <td colspan="2">Okul No</td>
    <td colspan="3">Açıklama</td>
    <td colspan="10">Adı    Soyadı</td>
    <td colspan="6">Sınıfı</td>
    <td colspan="2">Okul No</td>
    <td colspan="3">Açıklama</td>
  </tr>
  <tr height="15">
    <?php do { ?>
      <td colspan="11" height="15"><?php echo $row_ogrenciler1['ogrenci_adsoyad']; ?> </td>
      <td colspan="6"><?php echo $row_ogrenciler1['ogrenci_sinif']; ?></td>
      <td colspan="2"><?php echo $row_ogrenciler1['ogrenci_no']; ?></td>
      <?php } while ($row_ogrenciler1 = mysql_fetch_assoc($ogrenciler1)); ?>
    <td colspan="3">&nbsp;</td>
    <?php do { ?>
      <td colspan="10"><?php echo $row_ogrenciler2['ogrenci_adsoyad']; ?></td>
      <td colspan="6"><?php echo $row_ogrenciler2['ogrenci_sinif']; ?></td>
      <td colspan="2"><?php echo $row_ogrenciler2['ogrenci_no']; ?></td>
      <?php } while ($row_ogrenciler2 = mysql_fetch_assoc($ogrenciler2)); ?>
<td colspan="3">&nbsp;</td>
  </tr>
  <tr height="15">
    <td colspan="11" height="15">&nbsp;</td>
    <td colspan="6">&nbsp;</td>
    <td colspan="2">&nbsp;</td>
    <td colspan="3">&nbsp;</td>
    <td colspan="10">&nbsp;</td>
    <td colspan="6">&nbsp;</td>
    <td colspan="2">&nbsp;</td>
    <td colspan="3">&nbsp;</td>
  </tr>
  <tr height="15">
    <td colspan="11" height="15">&nbsp;</td>
    <td colspan="6">&nbsp;</td>
    <td colspan="2">&nbsp;</td>
    <td colspan="3">&nbsp;</td>
    <td colspan="10">&nbsp;</td>
    <td colspan="6">&nbsp;</td>
    <td colspan="2">&nbsp;</td>
    <td colspan="3">&nbsp;</td>
  </tr>
  <tr height="15">
    <td colspan="11" height="15">&nbsp;</td>
    <td colspan="6">&nbsp;</td>
    <td colspan="2">&nbsp;</td>
    <td colspan="3">&nbsp;</td>
    <td colspan="10">&nbsp;</td>
    <td colspan="6">&nbsp;</td>
    <td colspan="2">&nbsp;</td>
    <td colspan="3">&nbsp;</td>
  </tr>
  <tr height="15">
    <td colspan="11" height="15">&nbsp;</td>
    <td colspan="6">&nbsp;</td>
    <td colspan="2">&nbsp;</td>
    <td colspan="3">&nbsp;</td>
    <td colspan="10">&nbsp;</td>
    <td colspan="6">&nbsp;</td>
    <td colspan="2">&nbsp;</td>
    <td colspan="3">&nbsp;</td>
  </tr>
  <tr height="15">
    <td colspan="11" height="15">&nbsp;</td>
    <td colspan="6">&nbsp;</td>
    <td colspan="2">&nbsp;</td>
    <td colspan="3">&nbsp;</td>
    <td colspan="10">&nbsp;</td>
    <td colspan="6">&nbsp;</td>
    <td colspan="2">&nbsp;</td>
    <td colspan="3">&nbsp;</td>
  </tr>
  <tr height="15">
    <td colspan="11" height="15">&nbsp;</td>
    <td colspan="6">&nbsp;</td>
    <td colspan="2">&nbsp;</td>
    <td colspan="3">&nbsp;</td>
    <td colspan="10">&nbsp;</td>
    <td colspan="6">&nbsp;</td>
    <td colspan="2">&nbsp;</td>
    <td colspan="3">&nbsp;</td>
  </tr>
  <tr height="15">
    <td colspan="8" rowspan="2" height="30">İş Yerinde Çalışan Çırak Sayısı :</td>
    <td colspan="3" rowspan="2">&nbsp;<?php echo $totalRows_ogrenciler1 ?> </td>
    <td colspan="6">Sözleşmeli</td>
    <td colspan="2">Sözleşmesiz</td>
    <td colspan="3" rowspan="2">&nbsp;</td>
    <td colspan="8" rowspan="2">İş Yerinde    Çalışan Çırak Sayısı :</td>
    <td colspan="2" rowspan="2">&nbsp;<?php echo $totalRows_ogrenciler2 ?> </td>
    <td colspan="6">Sözleşmeli</td>
    <td colspan="2">Sözleşmesiz</td>
    <td colspan="3" rowspan="2">&nbsp;</td>
  </tr>
  <tr height="15">
    <td colspan="6" height="15"><div align="center">X</div></td>
    <td colspan="2">&nbsp;</td>
    <td colspan="6"><div align="center">X</div></td>
    <td colspan="2">&nbsp;</td>
  </tr>
  <tr height="15">
    <td colspan="22" height="15">İş yeri ve Öğrenci Hakkındaki Bilgiler; (İlgili kutuyu    İşaretleyin)</td>
    <td colspan="21">İş    yeri ve Öğrenci Hakkındaki Bilgiler; (İlgili kutuyu İşaretleyin)</td>
  </tr>
  <tr height="8">
    <td height="8" width="9">&nbsp;</td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td width="17">&nbsp;</td>
    <td width="6">&nbsp;</td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td width="13">&nbsp;</td>
  </tr>
  <tr height="15">
    <td height="15" width="9">&nbsp;</td>
    <td>X</td>
    <td></td>
    <td colspan="8">Öğrenci pratik eğitimini    sürdürmektedir.</td>
    <td></td>
    <td>&nbsp;</td>
    <td></td>
    <td colspan="6">İş yeri adresi    değişmiştir.</td>
    <td></td>
    <td width="17">&nbsp;</td>
    <td width="6">&nbsp;</td>
    <td>X</td>
    <td></td>
    <td colspan="7">Öğrenci pratik eğitimini    sürdürmektedir.</td>
    <td></td>
    <td>&nbsp;</td>
    <td></td>
    <td colspan="6">İş yeri adresi    değişmiştir.</td>
    <td></td>
    <td width="13">&nbsp;</td>
  </tr>
  <tr height="6">
    <td height="6" width="9">&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td width="17">&nbsp;</td>
    <td width="6">&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td width="13">&nbsp;</td>
  </tr>
  <tr height="7">
    <td height="7" width="9">&nbsp;</td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td width="17">&nbsp;</td>
    <td width="6">&nbsp;</td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td width="13">&nbsp;</td>
  </tr>
  <tr height="15">
    <td height="15" width="9">&nbsp;</td>
    <td>&nbsp;</td>
    <td></td>
    <td colspan="6">Öğrenci iş yerinden    ayrılmıştır.</td>
    <td></td>
    <td></td>
    <td></td>
    <td>&nbsp;</td>
    <td></td>
    <td colspan="6">İş yeri şu anda    kapalıdır.</td>
    <td></td>
    <td width="17">&nbsp;</td>
    <td width="6">&nbsp;</td>
    <td>&nbsp;</td>
    <td></td>
    <td colspan="6">Öğrenci iş yerinden    ayrılmıştır.</td>
    <td></td>
    <td></td>
    <td>&nbsp;</td>
    <td></td>
    <td colspan="6">İş yeri şu anda    kapalıdır.</td>
    <td></td>
    <td width="13">&nbsp;</td>
  </tr>
  <tr height="5">
    <td height="5" width="9">&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td width="17">&nbsp;</td>
    <td width="6">&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td width="13">&nbsp;</td>
  </tr>
  <tr height="8">
    <td height="8" width="9">&nbsp;</td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td width="17">&nbsp;</td>
    <td width="6">&nbsp;</td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td width="13">&nbsp;</td>
  </tr>
  <tr height="15">
    <td height="15" width="9">&nbsp;</td>
    <td>&nbsp;</td>
    <td></td>
    <td colspan="8">İşveren olmadığı için    imza ve görüş alınamadı</td>
    <td></td>
    <td>&nbsp;</td>
    <td></td>
    <td colspan="4">Diğer hususlar</td>
    <td></td>
    <td></td>
    <td></td>
    <td width="17">&nbsp;</td>
    <td width="6">&nbsp;</td>
    <td>&nbsp;</td>
    <td></td>
    <td colspan="9">İşveren    olmadığı için imza ve görüş alınamadı</td>
    <td></td>
    <td>&nbsp;</td>
    <td></td>
    <td colspan="4">Diğer hususlar</td>
    <td></td>
    <td></td>
    <td width="1"></td>
    <td width="4">&nbsp;</td>
  </tr>
  <tr height="8">
    <td height="8" width="9">&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td width="17">&nbsp;</td>
    <td width="6">&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td width="13">&nbsp;</td>
  </tr>
  <tr height="5">
    <td height="5" width="9">&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td width="17">&nbsp;</td>
    <td width="6">&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td width="13">&nbsp;</td>
  </tr>
  <tr height="15">
    <td height="15" width="9">&nbsp;</td>
    <td colspan="10">Pratik Eğitim konusu ve    Öğretmenin görüş ve</td>
    <td>&nbsp;</td>
    <td colspan="9">Usta Öğreticinin görüş    gözlem ve istekleri</td>
    <td width="17">&nbsp;</td>
    <td width="6">&nbsp;</td>
    <td colspan="9">Pratik Eğitim konusu ve    Öğretmenin görüş ve</td>
    <td>&nbsp;</td>
    <td colspan="9">Usta Öğreticinin görüş    gözlem ve istekleri</td>
    <td width="13">&nbsp;</td>
  </tr>
  <tr height="15">
    <td height="15" width="9">&nbsp;</td>
    <td colspan="4" rowspan="2">gözlemleri</td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td>&nbsp;</td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td width="17">&nbsp;</td>
    <td width="6">&nbsp;</td>
    <td colspan="4" rowspan="2">gözlemleri</td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td>&nbsp;</td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td width="13">&nbsp;</td>
  </tr>
  <tr height="17">
    <td height="17" width="9">&nbsp;</td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td>&nbsp;</td>
    <td colspan="2">Var</td>
    <td>&nbsp;</td>
    <td></td>
    <td></td>
    <td>Yok</td>
    <td>X</td>
    <td></td>
    <td></td>
    <td width="17">&nbsp;</td>
    <td width="6">&nbsp;</td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td>&nbsp;</td>
    <td colspan="2">Var</td>
    <td>&nbsp;</td>
    <td></td>
    <td></td>
    <td>Yok</td>
    <td>X</td>
    <td></td>
    <td></td>
    <td width="13">&nbsp;</td>
  </tr>
  <tr height="6">
    <td height="6" width="9">&nbsp;</td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td>&nbsp;</td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td width="17">&nbsp;</td>
    <td width="6">&nbsp;</td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td>&nbsp;</td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td width="13">&nbsp;</td>
  </tr>
  <tr height="164">
    <td height="164" colspan="11" align="left" valign="top"><?php do { ?>
        <p><?php echo $row_konu['konu']; ?></p>
        <p>-----------------------------------------</p>
    <?php } while ($row_konu = mysql_fetch_assoc($konu)); ?></td>
    <td colspan="11">&nbsp;</td>
    <td colspan="10" align="left" valign="top"><?php do { ?>
        <p><?php echo $row_konu2['konu']; ?></p>
        <p>------------------------------------------</p>
    <?php } while ($row_konu2 = mysql_fetch_assoc($konu2)); ?></td>
    <td colspan="11">&nbsp;</td>
  </tr>
  <tr height="15">
    <td colspan="11" height="15">İş yerinde/İşletmedeki Mesleki Eğitim Çalışmalarına</td>
    <td colspan="6">  Başlama Saati</td>
    <td>&nbsp;</td>
    <td colspan="3">Bitiş Saati</td>
    <td width="17">&nbsp;</td>
    <td colspan="10">İş    yerinde/İşletmedeki Mesleki Eğitim Çalışmalarına</td>
    <td colspan="6">  Başlama Saati</td>
    <td>&nbsp;</td>
    <td colspan="3">Bitiş Saati</td>
    <td width="13">&nbsp;</td>
  </tr>
  <tr height="15">
    <td height="15" width="9">&nbsp;</td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td colspan="3">İncelenmiştir.</td>
    <td></td>
    <td></td>
    <td></td>
    <td width="17">&nbsp;</td>
    <td width="6">&nbsp;</td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td colspan="3">İncelenmiştir.</td>
    <td></td>
    <td></td>
    <td></td>
    <td width="13">&nbsp;</td>
  </tr>
  <tr height="15">
    <td height="15" width="9">&nbsp;</td>
    <td></td>
    <td></td>
    <td colspan="5">........../........../2011</td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td colspan="4">........../........../2011</td>
    <td></td>
    <td></td>
    <td width="17">&nbsp;</td>
    <td width="6">&nbsp;</td>
    <td></td>
    <td></td>
    <td colspan="4">........../........../2011</td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td colspan="3">........../........../2011</td>
    <td></td>
    <td></td>
    <td></td>
    <td width="13">&nbsp;</td>
  </tr>
  <tr height="9">
    <td height="9" width="9">&nbsp;</td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td width="17">&nbsp;</td>
    <td width="6">&nbsp;</td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td width="13">&nbsp;</td>
  </tr>
  <tr height="8">
    <td height="8" width="9">&nbsp;</td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td width="17">&nbsp;</td>
    <td width="6">&nbsp;</td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td width="13">&nbsp;</td>
  </tr>
  <tr height="15">
    <td height="15" width="9">&nbsp;</td>
    <td></td>
    <td colspan="7">Efrail DÖKME</td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td colspan="3">Ziya SOYLU</td>
    <td></td>
    <td></td>
    <td></td>
    <td width="17">&nbsp;</td>
    <td width="6">&nbsp;</td>
    <td></td>
    <td></td>
    <td colspan="7">Efrail DÖKME</td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td colspan="3">Ziya SOYLU</td>
    <td></td>
    <td></td>
    <td></td>
    <td width="13">&nbsp;</td>
  </tr>
  <tr height="15">
    <td height="15" width="9">&nbsp;</td>
    <td></td>
    <td colspan="7">Meslek Dersi Öğretmeni</td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td colspan="4">Müdür Yardımcısı</td>
    <td></td>
    <td></td>
    <td width="17">&nbsp;</td>
    <td width="6">&nbsp;</td>
    <td></td>
    <td></td>
    <td colspan="7">Meslek Dersi Öğretmeni</td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td colspan="4">Müdür Yardımcısı</td>
    <td></td>
    <td></td>
    <td width="13">&nbsp;</td>
  </tr>
  <tr height="14">
    <td height="14" width="9">&nbsp;</td>
    <td width="15"></td>
    <td width="6"></td>
    <td width="24"></td>
    <td width="24"></td>
    <td width="26"></td>
    <td width="26"></td>
    <td width="26"></td>
    <td width="26"></td>
    <td width="14"></td>
    <td width="58"></td>
    <td width="18"></td>
    <td width="29"></td>
    <td width="15"></td>
    <td width="35"></td>
    <td width="48"></td>
    <td width="16"></td>
    <td width="113"></td>
    <td width="40"></td>
    <td width="20"></td>
    <td width="20"></td>
    <td width="17">&nbsp;</td>
    <td width="6">&nbsp;</td>
    <td width="15"></td>
    <td width="5"></td>
    <td width="30"></td>
    <td width="30"></td>
    <td width="35"></td>
    <td width="35"></td>
    <td width="34"></td>
    <td width="34"></td>
    <td width="11"></td>
    <td width="42"></td>
    <td width="17"></td>
    <td width="6"></td>
    <td width="6"></td>
    <td width="42"></td>
    <td width="22"></td>
    <td width="56"></td>
    <td width="22"></td>
    <td width="22"></td>
    <td width="22"></td>
    <td width="13">&nbsp;</td>
  </tr>
  <tr height="14">
    <td height="14">&nbsp;</td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td>&nbsp;</td>
  </tr>
  <tr height="14">
    <td height="14">&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
</table>
</body>
</html>
<?php
mysql_free_result($isveren1);

mysql_free_result($isveren2);

mysql_free_result($ogrenciler1);

mysql_free_result($ogrenciler2);

mysql_free_result($konu);

mysql_free_result($konu2);
?>
koordinatörlük evraklarını bütün öğretmenlerin doldurması çok zaman kaybına neden oluyor böyle birşey yapalım dedim hayrıma:) sistemi anlayım isterseniz. öğretmen sayfanın birinden TC kimlik numarasını girdiğinde kendi işletmelri karşısına geliyor ordan hangilerinin formunu hazırlamak istiyorsa onları seçiyor haftayı da aynı sayfadan seçiyor butona bastığında değerler bu sayfaya gönderiliyor bu sayfada veri tabanından değerler çekilip ilgili yerlere yazılıyor bir sayfada 2 ayrı işletmenin formu gösteriliyor(kağıt israfını önlemek için. excelde yapmıştım programı ama bir işyerinde birden fazla çırak çalışınca sorun oluyor.birde böylesi daha profesyonel görünüyor
 
$query_konu2 = "SELECT * FROM plan WHERE plan.hafta_no = $hafta AND plan.ogrenci_meslek = '".$row_ogrenciler2['ogrenci_meslek']."' AND plan.ogrenci_sinif = '".$row_ogrenciler2['ogrenci_sinif']."' AND plan.ogrenci_donem = '".$row_ogrenciler2['ogrenci_donem']."'";

bir kere her alanın başına tablo adı yazmak zorunda degilsin. şeklinde kullanman çözümdür :) kolay gelsin
 
sprintf fonksiyonun ne işe yaradığını çıkartamadım.
Şu değerler düzgün geliyormu gelmiyormu bir onu kontrol et bence. sıkıntı bunlarda gibime geliyor. echo ile ekrana yazdırarak değerin geldiğini bir kontrol et.
$row_ogrenciler1['ogrenci_meslek']
$row_ogrenciler1['ogrenci_sinif']
$row_ogrenciler1['ogrenci_donem']
 
teşekkür ederim hocam şimdi pek zamanım yok eve gidince deneyeceğim olursa haftaya yazarım buraya.
hocam sorun size verdiğim sorgu satırından kaynaklanıyordu(hata sayfasında orayı işaret ediyordu) bakalım eve gidince deneyeceğim olacak mı bakalım
 
dokmeefrail' Alıntı:
teşekkür ederim hocam şimdi pek zamanım yok eve gidince deneyeceğim olursa haftaya yazarım buraya.
hocam sorun size verdiğim sorgu satırından kaynaklanıyordu(hata sayfasında orayı işaret ediyordu) bakalım eve gidince deneyeceğim olacak mı bakalım
sprintf mantiğınıda anlatırsan sevinim. Merak ettim doğrusu. :)
 
php ile sprintf() kullanımı

Ekim 14, 2010 | In: PHP

Üzerinde çalıştığım projede manuel id üretmem gerekti. Madem yaptım blog da da paylaşayım dedim. Biraz hızlı yazılan bir yazı oldu anlaşılmayan noktalarda yardım olmaya çalışırım

Üretmem gereken veri
örn: uzks00000000001
şeklinde 4 harf karakter 11 rakam dan oluşan bir id. Ve manuel yükseltilecek;

Tabiki ihtiyaci diğer veride db de kayıt edilmiş son id yi almak. bunun için bir kod eklemeyeceğim.

Aldığımızı var saydığımız $son_id = uzks00000000011; olsun.
substr() komutu ile harf ve rakamları ayırdık. ilk 4 karakter harf olduğu için substr() işimi kolayca gördü.


view source
print?
1 $son_rakam=substr($son_id,4,11);
2
3 $son_rakam++; // aldığımız 00000000011 sonucunu 1 arttırdık.

Asıl sorun burada başlıyor. $son_rakam değişkenini değeri 12 oldu yani başındaki 9 adet 0 karakteri kayboldu.

Anlatmak istediğim konu sprintf komutunu burada kullanıyoruz.


view source
print?
1 $son_kodu=sprintf("uzks%011ld",$son_rakam);



Çıktı :
uzks00000000012

sprintf() komudu ile kullandığım sistemi şöyle açıklayabilirim.
uzks -> sabit 4 harf
%011ld ->
%= işareti sprintf de gelen verinin basılacağı alanın başlangıç noktası olarak düşünebiliriz.
0 = rakamı gelen değişkenden arta kalan karater alanlarını 0 ile doldur demek
11 = toplam da kullanılacak karakter sayısı
ld = sprintf() içinde gönderdiğimiz değişkendeki veriyi basacağı alandır. ve large integer anlamına gelir. s , d gibi 2 parametre daha kullanılabilir. s = string , d= integer değer anlamına gelir.
DEMİŞ SİTENİN BİRİNDE GÜZEL DE ANLATMIŞ BENCE :lol:
 
BBNET
Geri
Üst