 |
|
|
 |
 |
|
มันหน้าจะเกิดจากการที่เปิด ดูฐานข้อมูลแล้ว ไม่มีชื่อ คอรัมนั้น
ตรวจให้ดีๆนะครับ ว่า คุณพิมพ์ถูกไหม ตรง ซีเล็ค อะครับ
|
 |
 |
 |
 |
Date :
2010-05-27 15:03:16 |
By :
ไก่ |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
แต่ถ้าค้นเจอมันก็จะแสดงข้อมูลนะคะ
แต่พอไม่มีข้อมูลมันเกิด error ตรงจุดไหนเหรอคะนั่งดูจนไม่รู้จะแก้ไงแล้วอ่า
|
 |
 |
 |
 |
Date :
2010-05-27 15:14:01 |
By :
kabton_hok |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอดูคำสั่ง select ของคุณหน่อยได้ไหมครับ
|
 |
 |
 |
 |
Date :
2010-05-27 15:27:26 |
By :
SOUL |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
$pro= mysql_query("select * from project where mon_pro = '$mon_pro' && year_pro = '$year_pro'");
|
 |
 |
 |
 |
Date :
2010-05-27 15:29:34 |
By :
kabton_hok |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (PHP)
$strSQL="SELECT * FROM project WHERE mon_pro LIKE '%".'$mon_pro."%' and year_pro LIKE '%".$year_pro."%' ORDER BY id ASC ";
$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
ลองเขียนแบบนี้ดูนะครับ อิอิอิอิอิอิ
|
 |
 |
 |
 |
Date :
2010-05-27 15:35:25 |
By :
SOUL |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ลอง เขียนโคด ดักไว้ สิ ครับ ว่าถ้าไม่มี ให้แสดงค่าอะไร ออกมา
- -
|
 |
 |
 |
 |
Date :
2010-05-27 15:41:52 |
By :
rakket |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ได้แล้วบอกด้วยนะครับ
|
 |
 |
 |
 |
Date :
2010-05-27 15:59:47 |
By :
SOUL |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Parse error: syntax error, unexpected T_STRING in C:\AppServ\www\seminar\user_report_project_data3.php on line 6
|
 |
 |
 |
 |
Date :
2010-05-27 16:00:24 |
By :
kabton_hok |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอดู code หน้านี้ทั้งหน้าเลยครับ เดียวผมแก้ให้เลย
|
 |
 |
 |
 |
Date :
2010-05-27 16:02:33 |
By :
SOUL |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เอาแบบตั้งแต่แรกนะคะ อาจจะดูงงหน่อยนะคะ
<?php
session_start();
include("connect.php");
//$m_pro = $_GET['mon_pro1'];
//$y_pro = $_GET['year_pro1'];
$pro= mysql_query("select * from project where mon_pro = '$mon_pro' && year_pro = '$year_pro'");
//$pro = mysql_query("select * from project where mon_pro = '$mon_pro' && year_pro = '$year_pro' ORDER BY year_pro desc, mon_pro asc, id_pro asc;");
//$pro = mysql_query("select * from project ORDER BY year_pro desc, mon_pro asc, id_pro asc LIMIT $start,$limitrow;");
$id_p = mysql_result($pro,0,"id_pro");
$per= mysql_query("select * from per_project where id_pro = '$id_p' order by id_per asc");
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>ระบบอบรม/สัมมนาและนิทรรศการ</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874">
<link href="style.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
body { background-color: #000000 }
body,td,th {
font-size: 12px;
font-family: tahoma;
}
.style21 {color: #FFFFFF}
.style8 { font-size: 12px;
color: #000000;
font-family: tahoma;
}
.style9 { font-family: tahoma;
font-size: 12px;
}
.style20 {font-size: 12px;
font-weight: bold;
}
-->
</style>
</head>
<body topmargin="0" leftmargin="0" rightmargin="0" background="image/BG.gif">
<form action="" method="post" name="form1" enctype="multipart/form-data">
<div align="center">
<table width="100%" border="0" cellpadding="0" cellspacing="0" background="image/BG.gif" bgcolor="#FFFFFF">
<tr>
<th scope="col"></th>
</tr>
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="3">
<tr>
<th height="392" valign="top" scope="col"><table width="100%" border="1" cellpadding="1" cellspacing="0" bordercolor="#000000">
<tr>
<td><table width="100%" border="0" cellpadding="2" cellspacing="0" bgcolor="#F0FAFF">
<tr>
<td width="100%" height="15" align="left" valign="bottom"><div align="center"></div></td>
</tr>
<tr>
<td height="28" align="left" valign="bottom"><div align="center" class="style20"> รายงานข้อมูลการอบรม/สัมมนา </div>
<div align="center"></div></td>
</tr>
<tr >
<td height="18" align="left" valign="bottom"><div align="center"></div></td>
</tr>
<tr >
<td height="15" align="left" valign="bottom"><div align="center"><strong>ประจำเดือน <?php echo "$mon_pro"; ?> ปี <?php echo "$year_pro"; ?></strong></div></td>
</tr>
<tr >
<td height="15" align="left" valign="bottom"><div align="center"></div></td>
</tr>
<tr>
<td><div align="center">
<table width="100%" border="0" cellspacing="0" cellpadding="2">
<tr>
<td width="590" align="left" valign="bottom"><div align="left"><strong> </strong> <strong> </strong>
</div></td>
</tr>
<tr>
<td><table width="100%" border="1" cellpadding="1" cellspacing="0" bordercolor="#000000" bgcolor="#FFFFFF">
<tr>
<td height="54" align="center"><table width="100%" height="67" border="0" align="center" cellpadding="1" cellspacing="1" bordercolor="#000000" bgcolor="#FFFFFF">
<tr bgcolor="#23a5e3">
<td width="35" align="center" ><span class="style21">ลำดับ</span></td>
<td width="236" align="center" bgcolor="#23a5e3" ><span class="style21">ชื่อการอบรม/สัมมนา</span></td>
<td width="119" align="center" ><span class="style21">วันที่</span></td>
<td width="85" align="center" ><span class="style21">เวลา</span></td>
<td width="130" align="center" ><span class="style21">สถานที่ </span></td>
<td width="136" align="center" ><span class="style21">หน่วยงาน</span></td>
<td width="230" align="center" ><span class="style21">ผู้รับผิดชอบ</span></td>
</tr>
<?php
if(mysql_num_rows($pro)!= 0)
{
for($i = 0;$i < mysql_num_rows($pro);$i++)
{
?>
<tr bgcolor="#F0FAFF" >
<td height="25" align="center" ><span class=""><?php echo $i+1; ?></span></td>
<td width="236" align="left" bgcolor="#F0FAFF"> <?php echo mysql_result($pro,$i,"n_project"); ?></td>
<td align="left"><div align="center"><?php echo mysql_result($pro,$i,"date_pro"); ?> <?php echo mysql_result($pro,$i,"mon_pro"); ?> <?php echo mysql_result($pro,$i,"year_pro"); ?></div></td>
<td align="left"><div align="center"><?php echo mysql_result($pro,$i,"time_pro"); ?> น.</div></td>
<td align="left" bgcolor="#F0FAFF"><div align="left"> <?php echo mysql_result($pro,$i,"location"); ?></div></td>
<td align="left" bgcolor="#F0FAFF"><div align="left"> <?php echo mysql_result($pro,$i,"insti"); ?></div></td>
<td align="left"><table width="100%" border="0" cellpadding="1" cellspacing="1" bordercolor="#000000">
<?php
if(mysql_num_rows($per)!= 0)
{
for($t= 0;$t < mysql_num_rows($per);$t++)
{
?>
<tr>
<td><? echo $t+1;?>.
<?php
$id_p = mysql_result($per,$t,"id_per");
$p_pro= mysql_query("select * from person where id_per = '$id_p' order by id_per asc");
echo mysql_result($p_pro,0,"prefix");
echo mysql_result($p_pro,0,"p_name");
?></td>
</tr>
<?php }
}
else
{?>
<tr>
<td></td>
</tr>
<?php } ?>
</table></td>
</tr>
<?php }
}
else
{?>
<tr bgcolor="#F0FAFF" >
<td colspan="7" align="center"><div align="center" class="style9">
<p>ไม่พบข้อมูล</p>
</div></td>
</tr>
<?php } ?>
</table></td>
</tr>
</table></td>
</tr>
</table>
</div></td>
</tr>
<tr>
<td height="18"><div align="center"><span class="style11 style8">
<input name="mon_pro1" type="hidden" value="<? echo $mon_pro; ?>">
<input name="year_pro1" type="hidden" value="<? echo $year_pro; ?>">
<input name="back" type="button" id="back" onClick="document.form1.action='user_report_project1.php?search=1';document.form1.submit();" value="กลับ">
<input name="Button2" type="button" onClick="document.form1.action='user_p_report_project_data3.php';document.form1.target='_blank';document.form1.submit();document.form1.target='';" value="พิมพ์" />
</span>
</div></td>
</tr>
<div align="center"> </div>
</table></td>
</tr>
</table>
<p> </p>
<p> </p></th>
</tr>
</table></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><div align="center">
</div>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
|
 |
 |
 |
 |
Date :
2010-05-27 16:07:40 |
By :
kabton_hok |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (PHP)
ลองดูอีกรอบครับ ถ้าไม่ได้บอกด้วยนะครับ
<?php
session_start();
include("connect.php");
//$m_pro = $_GET['mon_pro1'];
//$y_pro = $_GET['year_pro1'];
$pro= mysql_query("select * from project where mon_pro = '$mon_pro' and year_pro = '$year_pro'");
//$pro = mysql_query("select * from project where mon_pro = '$mon_pro' && year_pro = '$year_pro' ORDER BY year_pro desc, mon_pro asc, id_pro asc;");
//$pro = mysql_query("select * from project ORDER BY year_pro desc, mon_pro asc, id_pro asc LIMIT $start,$limitrow;");
$id_p = mysql_result($pro,0,'id_pro');
$per= mysql_query("select * from per_project where id_pro = '$id_p' order by id_per asc");
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>ระบบอบรม/สัมมนาและนิทรรศการ</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874">
<link href="style.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
body { background-color: #000000 }
body,td,th {
font-size: 12px;
font-family: tahoma;
}
.style21 {color: #FFFFFF}
.style8 { font-size: 12px;
color: #000000;
font-family: tahoma;
}
.style9 { font-family: tahoma;
font-size: 12px;
}
.style20 {font-size: 12px;
font-weight: bold;
}
-->
</style>
</head>
<body topmargin="0" leftmargin="0" rightmargin="0" background="image/BG.gif">
<form action="" method="post" name="form1" enctype="multipart/form-data">
<div align="center">
<table width="100%" border="0" cellpadding="0" cellspacing="0" background="image/BG.gif" bgcolor="#FFFFFF">
<tr>
<th scope="col"></th>
</tr>
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="3">
<tr>
<th height="392" valign="top" scope="col"><table width="100%" border="1" cellpadding="1" cellspacing="0" bordercolor="#000000">
<tr>
<td><table width="100%" border="0" cellpadding="2" cellspacing="0" bgcolor="#F0FAFF">
<tr>
<td width="100%" height="15" align="left" valign="bottom"><div align="center"></div></td>
</tr>
<tr>
<td height="28" align="left" valign="bottom"><div align="center" class="style20"> รายงานข้อมูลการอบรม/สัมมนา </div>
<div align="center"></div></td>
</tr>
<tr >
<td height="18" align="left" valign="bottom"><div align="center"></div></td>
</tr>
<tr >
<td height="15" align="left" valign="bottom"><div align="center"><strong>ประจำเดือน <?php echo "$mon_pro"; ?> ปี <?php echo "$year_pro"; ?></strong></div></td>
</tr>
<tr >
<td height="15" align="left" valign="bottom"><div align="center"></div></td>
</tr>
<tr>
<td><div align="center">
<table width="100%" border="0" cellspacing="0" cellpadding="2">
<tr>
<td width="590" align="left" valign="bottom"><div align="left"><strong> </strong> <strong> </strong>
</div></td>
</tr>
<tr>
<td><table width="100%" border="1" cellpadding="1" cellspacing="0" bordercolor="#000000" bgcolor="#FFFFFF">
<tr>
<td height="54" align="center"><table width="100%" height="67" border="0" align="center" cellpadding="1" cellspacing="1" bordercolor="#000000" bgcolor="#FFFFFF">
<tr bgcolor="#23a5e3">
<td width="35" align="center" ><span class="style21">ลำดับ</span></td>
<td width="236" align="center" bgcolor="#23a5e3" ><span class="style21">ชื่อการอบรม/สัมมนา</span></td>
<td width="119" align="center" ><span class="style21">วันที่</span></td>
<td width="85" align="center" ><span class="style21">เวลา</span></td>
<td width="130" align="center" ><span class="style21">สถานที่ </span></td>
<td width="136" align="center" ><span class="style21">หน่วยงาน</span></td>
<td width="230" align="center" ><span class="style21">ผู้รับผิดชอบ</span></td>
</tr>
<?php
if(mysql_num_rows($pro)!= 0)
{
for($i = 0;$i < mysql_num_rows($pro);$i++)
{
?>
<tr bgcolor="#F0FAFF" >
<td height="25" align="center" ><span class=""><?php echo $i+1; ?></span></td>
<td width="236" align="left" bgcolor="#F0FAFF"> <?php echo mysql_result($pro,$i,"n_project"); ?></td>
<td align="left"><div align="center"><?php echo mysql_result($pro,$i,"date_pro"); ?> <?php echo mysql_result($pro,$i,"mon_pro"); ?> <?php echo mysql_result($pro,$i,"year_pro"); ?></div></td>
<td align="left"><div align="center"><?php echo mysql_result($pro,$i,"time_pro"); ?> น.</div></td>
<td align="left" bgcolor="#F0FAFF"><div align="left"> <?php echo mysql_result($pro,$i,"location"); ?></div></td>
<td align="left" bgcolor="#F0FAFF"><div align="left"> <?php echo mysql_result($pro,$i,"insti"); ?></div></td>
<td align="left"><table width="100%" border="0" cellpadding="1" cellspacing="1" bordercolor="#000000">
<?php
if(mysql_num_rows($per)!= 0)
{
for($t= 0;$t < mysql_num_rows($per);$t++)
{
?>
<tr>
<td><? echo $t+1;?>.
<?php
$id_p = mysql_result($per,$t,"id_per");
$p_pro= mysql_query("select * from person where id_per = '$id_p' order by id_per asc");
echo mysql_result($p_pro,0,"prefix");
echo mysql_result($p_pro,0,"p_name");
?></td>
</tr>
<?php }
}
else
{?>
<tr>
<td></td>
</tr>
<?php } ?>
</table></td>
</tr>
<?php }
}
else
{?>
<tr bgcolor="#F0FAFF" >
<td colspan="7" align="center"><div align="center" class="style9">
<p>ไม่พบข้อมูล</p>
</div></td>
</tr>
<?php } ?>
</table></td>
</tr>
</table></td>
</tr>
</table>
</div></td>
</tr>
<tr>
<td height="18"><div align="center"><span class="style11 style8">
<input name="mon_pro1" type="hidden" value="<? echo $mon_pro; ?>">
<input name="year_pro1" type="hidden" value="<? echo $year_pro; ?>">
<input name="back" type="button" id="back" onClick="document.form1.action='user_report_project1.php?search=1';document.form1.submit();" value="กลับ">
<input name="Button2" type="button" onClick="document.form1.action='user_p_report_project_data3.php';document.form1.target='_blank';document.form1.submit();document.form1.target='';" value="พิมพ์" />
</span>
</div></td>
</tr>
<div align="center"> </div>
</table></td>
</tr>
</table>
<p> </p>
<p> </p></th>
</tr>
</table></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><div align="center">
</div>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
|
 |
 |
 |
 |
Date :
2010-05-27 16:33:06 |
By :
SOUL |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เหมือนเดิมอ่าคุณ SOUL รบกวนจริงๆๆ
|
 |
 |
 |
 |
Date :
2010-05-27 16:50:37 |
By :
kabton_hok |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
มานขึ้น ERROR เหมือนเดิมป่าวครับ มันบอกว่า error บรรทัดที่ 8 เหมือนเดิมใช่ป่าวครับ Print screen มาแปะหน่อย อยากเห็น errorครับ
|
 |
 |
 |
 |
Date :
2010-05-27 16:57:41 |
By :
SOUL |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
มัน error แบบนี้อ่าคะ Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 4 in C:\AppServ\www\seminar\user_report_project_data3.php on line 10
พี่คะถ้ามันแก้ไม่ได้ก็ไม่เป็นไรคะ เกรงใจพี่นะ ยังไงก็ขอบคุณพี่มากนะคะ
|
 |
 |
 |
 |
Date :
2010-05-27 17:01:40 |
By :
kabton_hok |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (PHP)
$id_p = mysql_result($pro);
แก้เป็นแบบนี้ดูครับ
|
 |
 |
 |
 |
Date :
2010-05-27 17:07:51 |
By :
SOUL |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 4 in C:\AppServ\www\seminar\user_report_project_data3.php on line 10
error แบบนี้อีกแล้วอ่า เห่อๆ
|
 |
 |
 |
 |
Date :
2010-05-27 17:14:11 |
By :
kabton_hok |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ลองลบออกหน่อยได้ไหมครับ
|
 |
 |
 |
 |
Date :
2010-05-27 17:16:32 |
By :
SOUL |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ได้แล้วค่ะ ขอบคุณมากคะ ลบออกแล้วไม่มี error แล้วคะ ขอบคุณมาก(อีกครั้ง)
|
 |
 |
 |
 |
Date :
2010-05-27 17:21:08 |
By :
kabton_hok |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
อ้อ ผมขออธิบายครับ คือที่เป็นแบบนั้น นะเพราะตามหลักแล้วการเขียน mysql_result() จำเป็นต้องมีข้อมูลก่อน ถ้าจะเช็คว่ามีค่าในquery ก็เช็คว่า
iCode (PHP)
f($pro>'0'){ $id_p = mysql_result($pro,0,'id_pro'); }
เพราะว่าถ้าค่าตัวแปร$pro ไม่มีค่าทำให้เกิด ERROR ได้ครับ 
|
 |
 |
 |
 |
Date :
2010-05-27 17:27:15 |
By :
SOUL |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณนะคะพี่โอกาสหน้าจะรบกวนใหม่ อิอิ
|
 |
 |
 |
 |
Date :
2010-05-27 18:22:33 |
By :
kabton_hok |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เห่อๆๆ คุณ SOUL ค่ะ คือว่ามันไม่ติด error แล้วค่ะ แต่ว่าพอเพิ่มข้อมูลลงไปใหม่ค่า //$id_p = mysql_result($pro,0,'id_pro'); ที่ปิดไว้ไม่แสดงค่ะ ทำไงดีอ่า เมื่อกี้ไม่ได้ลองเพ่มข้อมูลอ่า
|
 |
 |
 |
 |
Date :
2010-05-27 20:11:06 |
By :
kabton_hok |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอดูโค้ดปัจจุบันได้มั้ยครับ เด๋วผมจัดให้
|
 |
 |
 |
 |
Date :
2010-05-27 20:36:47 |
By :
kerb |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
<?php
session_start();
include("connect.php");
//$m_pro = $_GET['mon_pro1'];
//$y_pro = $_GET['year_pro1'];
$pro= mysql_query("select * from project where mon_pro = '$mon_pro' and year_pro = '$year_pro'");
//$pro = mysql_query("select * from project where mon_pro = '$mon_pro' && year_pro = '$year_pro' ORDER BY year_pro desc, mon_pro asc, id_pro asc;");
//$pro = mysql_query("select * from project ORDER BY year_pro desc, mon_pro asc, id_pro asc LIMIT $start,$limitrow;");
//$id_p = mysql_result($pro,'id_pro');
$id_p = mysql_result($pro,0,'id_pro');
$per= mysql_query("select * from per_project where id_pro = '$id_p' order by id_per asc");
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>ระบบอบรม/สัมมนาและนิทรรศการ</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874">
<link href="style.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
body { background-color: #000000 }
body,td,th {
font-size: 12px;
font-family: tahoma;
}
.style21 {color: #FFFFFF}
.style8 { font-size: 12px;
color: #000000;
font-family: tahoma;
}
.style9 { font-family: tahoma;
font-size: 12px;
}
.style20 {font-size: 12px;
font-weight: bold;
}
-->
</style>
</head>
<body topmargin="0" leftmargin="0" rightmargin="0" background="image/BG.gif">
<form action="" method="post" name="form1" enctype="multipart/form-data">
<div align="center">
<table width="100%" border="0" cellpadding="0" cellspacing="0" background="image/BG.gif" bgcolor="#FFFFFF">
<tr>
<th scope="col"></th>
</tr>
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="3">
<tr>
<th height="392" valign="top" scope="col"><table width="100%" border="1" cellpadding="1" cellspacing="0" bordercolor="#000000">
<tr>
<td><table width="100%" border="0" cellpadding="2" cellspacing="0" bgcolor="#F0FAFF">
<tr>
<td width="100%" height="15" align="left" valign="bottom"><div align="center"></div></td>
</tr>
<tr>
<td height="28" align="left" valign="bottom"><div align="center" class="style20"> รายงานข้อมูลการอบรม/สัมมนา </div>
<div align="center"></div></td>
</tr>
<tr >
<td height="18" align="left" valign="bottom"><div align="center"></div></td>
</tr>
<tr >
<td height="15" align="left" valign="bottom"><div align="center"><strong>ประจำเดือน <?php echo "$mon_pro"; ?> ปี <?php echo "$year_pro"; ?></strong></div></td>
</tr>
<tr >
<td height="15" align="left" valign="bottom"><div align="center"></div></td>
</tr>
<tr>
<td><div align="center">
<table width="100%" border="0" cellspacing="0" cellpadding="2">
<tr>
<td width="590" align="left" valign="bottom"><div align="left"><strong> </strong> <strong> </strong>
</div></td>
</tr>
<tr>
<td><table width="100%" border="1" cellpadding="1" cellspacing="0" bordercolor="#000000" bgcolor="#FFFFFF">
<tr>
<td height="54" align="center"><table width="100%" height="67" border="0" align="center" cellpadding="1" cellspacing="1" bordercolor="#000000" bgcolor="#FFFFFF">
<tr bgcolor="#23a5e3">
<td width="35" align="center" ><span class="style21">ลำดับ</span></td>
<td width="236" align="center" bgcolor="#23a5e3" ><span class="style21">ชื่อการอบรม/สัมมนา</span></td>
<td width="119" align="center" ><span class="style21">วันที่</span></td>
<td width="85" align="center" ><span class="style21">เวลา</span></td>
<td width="130" align="center" ><span class="style21">สถานที่ </span></td>
<td width="136" align="center" ><span class="style21">หน่วยงาน</span></td>
<td width="230" align="center" ><span class="style21">ผู้รับผิดชอบ</span></td>
</tr>
<?php
if(mysql_num_rows($pro)!= 0)
{
for($i = 0;$i < mysql_num_rows($pro);$i++)
{
?>
<tr bgcolor="#F0FAFF" >
<td height="25" align="center" ><span class=""><?php echo $i+1; ?></span></td>
<td width="236" align="left" bgcolor="#F0FAFF"> <?php echo mysql_result($pro,$i,"n_project"); ?></td>
<td align="left"><div align="center"><?php echo mysql_result($pro,$i,"date_pro"); ?> <?php echo mysql_result($pro,$i,"mon_pro"); ?> <?php echo mysql_result($pro,$i,"year_pro"); ?></div></td>
<td align="left"><div align="center"><?php echo mysql_result($pro,$i,"time_pro"); ?> น.</div></td>
<td align="left" bgcolor="#F0FAFF"><div align="left"> <?php echo mysql_result($pro,$i,"location"); ?></div></td>
<td align="left" bgcolor="#F0FAFF"><div align="left"> <?php echo mysql_result($pro,$i,"insti"); ?></div></td>
<td align="left"><table width="100%" border="0" cellpadding="1" cellspacing="1" bordercolor="#000000">
<?php
if(mysql_num_rows($per)!= 0)
{
for($t= 0;$t < mysql_num_rows($per);$t++)
{
?>
<tr>
<td><? echo $t+1;?>.
<?php
$id_p = mysql_result($per,$t,"id_per");
$p_pro= mysql_query("select * from person where id_per = '$id_p' order by id_per asc");
echo mysql_result($p_pro,0,"prefix");
echo mysql_result($p_pro,0,"p_name");
?></td>
</tr>
<?php }
}
else
{?>
<tr>
<td></td>
</tr>
<?php } ?>
</table></td>
</tr>
<?php }
}
else
{?>
<tr bgcolor="#F0FAFF" >
<td colspan="7" align="center"><div align="center" class="style9">
<p>ไม่พบข้อมูล</p>
</div></td>
</tr>
<?php } ?>
</table></td>
</tr>
</table></td>
</tr>
</table>
</div></td>
</tr>
<tr>
<td height="18"><div align="center"><span class="style11 style8">
<input name="mon_pro1" type="hidden" value="<? echo $mon_pro; ?>">
<input name="year_pro1" type="hidden" value="<? echo $year_pro; ?>">
<input name="back" type="button" id="back" onClick="document.form1.action='user_report_project1.php?search=1';document.form1.submit();" value="กลับ">
<input name="Button2" type="button" onClick="document.form1.action='user_p_report_project_data3.php';document.form1.target='_blank';document.form1.submit();document.form1.target='';" value="พิมพ์" />
</span>
</div></td>
</tr>
<div align="center"> </div>
</table></td>
</tr>
</table>
<p> </p>
<p> </p></th>
</tr>
</table></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><div align="center">
</div>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
|
 |
 |
 |
 |
Date :
2010-05-29 09:57:51 |
By :
kabton_hok |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
โค้ดนี้มีปัญหาไรบ้างคับ
|
 |
 |
 |
 |
Date :
2010-05-29 15:10:55 |
By :
kerb |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (PHP) ผมเพิ่มแค่ if ตรง line 8-11
<?php
session_start();
include("connect.php");
//$m_pro = $_GET['mon_pro1'];
//$y_pro = $_GET['year_pro1'];
$pro= mysql_query("select * from project where mon_pro = '$mon_pro' and year_pro = '$year_pro'");
if($pro){
$id_p = mysql_result($pro,0,'id_pro');
$per= mysql_query("select * from per_project where id_pro = '$id_p' order by id_per asc");
}
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>ระบบอบรม/สัมมนาและนิทรรศการ</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874">
<link href="style.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
body { background-color: #000000 }
body,td,th {
font-size: 12px;
font-family: tahoma;
}
.style21 {color: #FFFFFF}
.style8 { font-size: 12px;
color: #000000;
font-family: tahoma;
}
.style9 { font-family: tahoma;
font-size: 12px;
}
.style20 {font-size: 12px;
font-weight: bold;
}
-->
</style>
</head>
<body topmargin="0" leftmargin="0" rightmargin="0" background="image/BG.gif">
<form action="" method="post" name="form1" enctype="multipart/form-data">
<div align="center">
<table width="100%" border="0" cellpadding="0" cellspacing="0" background="image/BG.gif" bgcolor="#FFFFFF">
<tr>
<th scope="col"></th>
</tr>
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="3">
<tr>
<th height="392" valign="top" scope="col"><table width="100%" border="1" cellpadding="1" cellspacing="0" bordercolor="#000000">
<tr>
<td><table width="100%" border="0" cellpadding="2" cellspacing="0" bgcolor="#F0FAFF">
<tr>
<td width="100%" height="15" align="left" valign="bottom"><div align="center"></div></td>
</tr>
<tr>
<td height="28" align="left" valign="bottom"><div align="center" class="style20"> รายงานข้อมูลการอบรม/สัมมนา </div>
<div align="center"></div></td>
</tr>
<tr >
<td height="18" align="left" valign="bottom"><div align="center"></div></td>
</tr>
<tr >
<td height="15" align="left" valign="bottom"><div align="center"><strong>ประจำเดือน <?php echo "$mon_pro"; ?> ปี <?php echo "$year_pro"; ?></strong></div></td>
</tr>
<tr >
<td height="15" align="left" valign="bottom"><div align="center"></div></td>
</tr>
<tr>
<td><div align="center">
<table width="100%" border="0" cellspacing="0" cellpadding="2">
<tr>
<td width="590" align="left" valign="bottom"><div align="left"><strong> </strong> <strong> </strong>
</div></td>
</tr>
<tr>
<td><table width="100%" border="1" cellpadding="1" cellspacing="0" bordercolor="#000000" bgcolor="#FFFFFF">
<tr>
<td height="54" align="center"><table width="100%" height="67" border="0" align="center" cellpadding="1" cellspacing="1" bordercolor="#000000" bgcolor="#FFFFFF">
<tr bgcolor="#23a5e3">
<td width="35" align="center" ><span class="style21">ลำดับ</span></td>
<td width="236" align="center" bgcolor="#23a5e3" ><span class="style21">ชื่อการอบรม/สัมมนา</span></td>
<td width="119" align="center" ><span class="style21">วันที่</span></td>
<td width="85" align="center" ><span class="style21">เวลา</span></td>
<td width="130" align="center" ><span class="style21">สถานที่ </span></td>
<td width="136" align="center" ><span class="style21">หน่วยงาน</span></td>
<td width="230" align="center" ><span class="style21">ผู้รับผิดชอบ</span></td>
</tr>
<?php
if(mysql_num_rows($pro)!= 0)
{
for($i = 0;$i < mysql_num_rows($pro);$i++)
{
?>
<tr bgcolor="#F0FAFF" >
<td height="25" align="center" ><span class=""><?php echo $i+1; ?></span></td>
<td width="236" align="left" bgcolor="#F0FAFF"> <?php echo mysql_result($pro,$i,"n_project"); ?></td>
<td align="left"><div align="center"><?php echo mysql_result($pro,$i,"date_pro"); ?> <?php echo mysql_result($pro,$i,"mon_pro"); ?> <?php echo mysql_result($pro,$i,"year_pro"); ?></div></td>
<td align="left"><div align="center"><?php echo mysql_result($pro,$i,"time_pro"); ?> น.</div></td>
<td align="left" bgcolor="#F0FAFF"><div align="left"> <?php echo mysql_result($pro,$i,"location"); ?></div></td>
<td align="left" bgcolor="#F0FAFF"><div align="left"> <?php echo mysql_result($pro,$i,"insti"); ?></div></td>
<td align="left"><table width="100%" border="0" cellpadding="1" cellspacing="1" bordercolor="#000000">
<?php
if(mysql_num_rows($per)!= 0)
{
for($t= 0;$t < mysql_num_rows($per);$t++)
{
?>
<tr>
<td><? echo $t+1;?>.
<?php
$id_p = mysql_result($per,$t,"id_per");
$p_pro= mysql_query("select * from person where id_per = '$id_p' order by id_per asc");
echo mysql_result($p_pro,0,"prefix");
echo mysql_result($p_pro,0,"p_name");
?></td>
</tr>
<?php }
}
else
{?>
<tr>
<td></td>
</tr>
<?php } ?>
</table></td>
</tr>
<?php }
}
else
{?>
<tr bgcolor="#F0FAFF" >
<td colspan="7" align="center"><div align="center" class="style9">
<p>ไม่พบข้อมูล</p>
</div></td>
</tr>
<?php } ?>
</table></td>
</tr>
</table></td>
</tr>
</table>
</div></td>
</tr>
<tr>
<td height="18"><div align="center"><span class="style11 style8">
<input name="mon_pro1" type="hidden" value="<? echo $mon_pro; ?>">
<input name="year_pro1" type="hidden" value="<? echo $year_pro; ?>">
<input name="back" type="button" id="back" onClick="document.form1.action='user_report_project1.php?search=1';document.form1.submit();" value="กลับ">
<input name="Button2" type="button" onClick="document.form1.action='user_p_report_project_data3.php';document.form1.target='_blank';document.form1.submit();document.form1.target='';" value="พิมพ์" />
</span>
</div></td>
</tr>
<div align="center"> </div>
</table></td>
</tr>
</table>
<p> </p>
<p> </p></th>
</tr>
</table></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><div align="center">
</div>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
|
 |
 |
 |
 |
Date :
2010-05-29 15:42:28 |
By :
kerb |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
มันก็ยังแก้ไม่ได้อยู่ดี มันยัง error แบบเดิมเลยค่ะพี่ ขอโทษทีหายไปหลายวันพอดีติดอบรมเป็นอาทิตย์
|
 |
 |
 |
 |
Date :
2010-06-04 08:50:47 |
By :
kabton_hok |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ต้องแก้ตาม No 12. บอกนะ แบบนี้
Code (PHP)
<?
$pro= mysql_query("select * from project where mon_pro = '$mon_pro' && year_pro = '$year_pro'");
$num = mysql_num_rows($pro);
if($num>0){
$id_p = mysql_result($pro,0,"id_pro");
$per= mysql_query("select * from per_project where id_pro = '$id_p' order by id_per asc");
}
?>
|
 |
 |
 |
 |
Date :
2010-06-04 09:29:05 |
By :
heng |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณมากนะค่ะ ได้แล้วคะ +1
|
 |
 |
 |
 |
Date :
2010-06-04 12:07:27 |
By :
kabton_hok |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|