Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,038

HOME > PHP > PHP Forum > error ช่วยดูหน่อยนะ Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL


error ช่วยดูหน่อยนะ Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL

 
Topic : 043390



โพสกระทู้ ( 71 )
บทความ ( 0 )



สถานะออฟไลน์



Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 4 in C:\AppServ\www\seminar\user_report_exhibition_data3.php on line 8


เวลาค้นหาข้อมูลแล้วมันเจอค่าว่างมันจะแสดง error เหมือนดัง code ข้างบน รบกวนช่วยดูหน่อย



Tag : - - - -

Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2010-05-27 14:46:27 By : kabton_hok View : 2109 Reply : 29
 

 

No. 1

Guest


มันหน้าจะเกิดจากการที่เปิด ดูฐานข้อมูลแล้ว ไม่มีชื่อ คอรัมนั้น
ตรวจให้ดีๆนะครับ ว่า คุณพิมพ์ถูกไหม ตรง ซีเล็ค อะครับ
Date : 2010-05-27 15:03:16 By : ไก่
 

 

No. 2



โพสกระทู้ ( 71 )
บทความ ( 0 )



สถานะออฟไลน์


แต่ถ้าค้นเจอมันก็จะแสดงข้อมูลนะคะ

แต่พอไม่มีข้อมูลมันเกิด error ตรงจุดไหนเหรอคะนั่งดูจนไม่รู้จะแก้ไงแล้วอ่า
Date : 2010-05-27 15:14:01 By : kabton_hok
 

 

No. 3



โพสกระทู้ ( 1,751 )
บทความ ( 0 )



สถานะออฟไลน์


ขอดูคำสั่ง select ของคุณหน่อยได้ไหมครับ
Date : 2010-05-27 15:27:26 By : SOUL
 

 

No. 4



โพสกระทู้ ( 71 )
บทความ ( 0 )



สถานะออฟไลน์


$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
 

 

No. 5



โพสกระทู้ ( 1,751 )
บทความ ( 0 )



สถานะออฟไลน์


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
 

 

No. 6



โพสกระทู้ ( 120 )
บทความ ( 0 )



สถานะออฟไลน์


ลอง เขียนโคด ดักไว้ สิ ครับ ว่าถ้าไม่มี ให้แสดงค่าอะไร ออกมา

- -
Date : 2010-05-27 15:41:52 By : rakket
 

 

No. 7



โพสกระทู้ ( 1,751 )
บทความ ( 0 )



สถานะออฟไลน์


ได้แล้วบอกด้วยนะครับ
Date : 2010-05-27 15:59:47 By : SOUL
 

 

No. 8



โพสกระทู้ ( 71 )
บทความ ( 0 )



สถานะออฟไลน์


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
 

 

No. 9



โพสกระทู้ ( 1,751 )
บทความ ( 0 )



สถานะออฟไลน์


ขอดู code หน้านี้ทั้งหน้าเลยครับ เดียวผมแก้ให้เลย
Date : 2010-05-27 16:02:33 By : SOUL
 

 

No. 10



โพสกระทู้ ( 71 )
บทความ ( 0 )



สถานะออฟไลน์


เอาแบบตั้งแต่แรกนะคะ อาจจะดูงงหน่อยนะคะ

<?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">&nbsp;<?php echo mysql_result($pro,$i,"n_project"); ?></td>
<td align="left"><div align="center"><?php echo mysql_result($pro,$i,"date_pro"); ?>&nbsp;<?php echo mysql_result($pro,$i,"mon_pro"); ?>&nbsp;<?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">&nbsp;<?php echo mysql_result($pro,$i,"location"); ?></div></td>
<td align="left" bgcolor="#F0FAFF"><div align="left">&nbsp;<?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>&nbsp;</p>
<p>&nbsp;</p></th>
</tr>
</table></td>
</tr>
<tr>
<td>&nbsp;</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
 

 

No. 11



โพสกระทู้ ( 1,751 )
บทความ ( 0 )



สถานะออฟไลน์


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">&nbsp;<?php echo mysql_result($pro,$i,"n_project"); ?></td>
<td align="left"><div align="center"><?php echo mysql_result($pro,$i,"date_pro"); ?>&nbsp;<?php echo mysql_result($pro,$i,"mon_pro"); ?>&nbsp;<?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">&nbsp;<?php echo mysql_result($pro,$i,"location"); ?></div></td>
<td align="left" bgcolor="#F0FAFF"><div align="left">&nbsp;<?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>&nbsp;</p>
<p>&nbsp;</p></th>
</tr>
</table></td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td><div align="center">
</div>

</td>
</tr>
</table>
</div>
</form>
</body>

</html>

Date : 2010-05-27 16:33:06 By : SOUL
 

 

No. 12



โพสกระทู้ ( 768 )
บทความ ( 0 )



สถานะออฟไลน์


Quote:
แต่ถ้าค้นเจอมันก็จะแสดงข้อมูลนะคะ
แต่พอไม่มีข้อมูลมันเกิด error ตรงจุดไหนเหรอคะนั่งดูจนไม่รู้จะแก้ไงแล้วอ่า

มัน Error อยู่แล้วครับ คำสั่ง mysql_result() มันจะดึงผลลัพท์ออกมาถ้ามีข้อมูลนะ
แต่ถ้าคุณคิวรี่แล้วไม่มีข้อมูลแล้ว มันก็ error สิครับ
ผมว่าคุณควรจะเช็คดูก่อนว่าคิวรี่ของคุณมีข้อมูลปะด้วย mysql_num_rows ถ้ามี row ค่อยใช้ mysql_result ถ้าไม่มีก็ให้ข้ามไป
Date : 2010-05-27 16:34:20 By : naskw
 

 

No. 13



โพสกระทู้ ( 71 )
บทความ ( 0 )



สถานะออฟไลน์


เหมือนเดิมอ่าคุณ SOUL รบกวนจริงๆๆ
Date : 2010-05-27 16:50:37 By : kabton_hok
 

 

No. 14



โพสกระทู้ ( 1,751 )
บทความ ( 0 )



สถานะออฟไลน์


มานขึ้น ERROR เหมือนเดิมป่าวครับ มันบอกว่า error บรรทัดที่ 8 เหมือนเดิมใช่ป่าวครับ Print screen มาแปะหน่อย อยากเห็น errorครับ
Date : 2010-05-27 16:57:41 By : SOUL
 

 

No. 15



โพสกระทู้ ( 71 )
บทความ ( 0 )



สถานะออฟไลน์


มัน 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
 

 

No. 16



โพสกระทู้ ( 1,751 )
บทความ ( 0 )



สถานะออฟไลน์


Code (PHP)
$id_p = mysql_result($pro);
แก้เป็นแบบนี้ดูครับ
Date : 2010-05-27 17:07:51 By : SOUL
 

 

No. 17



โพสกระทู้ ( 71 )
บทความ ( 0 )



สถานะออฟไลน์


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
 

 

No. 18



โพสกระทู้ ( 1,751 )
บทความ ( 0 )



สถานะออฟไลน์


ลองลบออกหน่อยได้ไหมครับ
Date : 2010-05-27 17:16:32 By : SOUL
 

 

No. 19



โพสกระทู้ ( 71 )
บทความ ( 0 )



สถานะออฟไลน์


ได้แล้วค่ะ ขอบคุณมากคะ ลบออกแล้วไม่มี error แล้วคะ ขอบคุณมาก(อีกครั้ง)
Date : 2010-05-27 17:21:08 By : kabton_hok
 

 

No. 20



โพสกระทู้ ( 1,751 )
บทความ ( 0 )



สถานะออฟไลน์


อ้อ ผมขออธิบายครับ คือที่เป็นแบบนั้น นะเพราะตามหลักแล้วการเขียน 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
 

 

No. 21



โพสกระทู้ ( 71 )
บทความ ( 0 )



สถานะออฟไลน์


ขอบคุณนะคะพี่โอกาสหน้าจะรบกวนใหม่ อิอิ
Date : 2010-05-27 18:22:33 By : kabton_hok
 

 

No. 22



โพสกระทู้ ( 71 )
บทความ ( 0 )



สถานะออฟไลน์


เห่อๆๆ คุณ SOUL ค่ะ คือว่ามันไม่ติด error แล้วค่ะ แต่ว่าพอเพิ่มข้อมูลลงไปใหม่ค่า //$id_p = mysql_result($pro,0,'id_pro'); ที่ปิดไว้ไม่แสดงค่ะ ทำไงดีอ่า เมื่อกี้ไม่ได้ลองเพ่มข้อมูลอ่า
Date : 2010-05-27 20:11:06 By : kabton_hok
 

 

No. 23



โพสกระทู้ ( 708 )
บทความ ( 0 )



สถานะออฟไลน์
Facebook

ขอดูโค้ดปัจจุบันได้มั้ยครับ เด๋วผมจัดให้
Date : 2010-05-27 20:36:47 By : kerb
 

 

No. 24



โพสกระทู้ ( 71 )
บทความ ( 0 )



สถานะออฟไลน์


<?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">&nbsp;<?php echo mysql_result($pro,$i,"n_project"); ?></td>
<td align="left"><div align="center"><?php echo mysql_result($pro,$i,"date_pro"); ?>&nbsp;<?php echo mysql_result($pro,$i,"mon_pro"); ?>&nbsp;<?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">&nbsp;<?php echo mysql_result($pro,$i,"location"); ?></div></td>
<td align="left" bgcolor="#F0FAFF"><div align="left">&nbsp;<?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>&nbsp;</p>
<p>&nbsp;</p></th>
</tr>
</table></td>
</tr>
<tr>
<td>&nbsp;</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
 

 

No. 25



โพสกระทู้ ( 708 )
บทความ ( 0 )



สถานะออฟไลน์
Facebook

โค้ดนี้มีปัญหาไรบ้างคับ
Date : 2010-05-29 15:10:55 By : kerb
 

 

No. 26



โพสกระทู้ ( 708 )
บทความ ( 0 )



สถานะออฟไลน์
Facebook

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">&nbsp;<?php echo mysql_result($pro,$i,"n_project"); ?></td>
<td align="left"><div align="center"><?php echo mysql_result($pro,$i,"date_pro"); ?>&nbsp;<?php echo mysql_result($pro,$i,"mon_pro"); ?>&nbsp;<?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">&nbsp;<?php echo mysql_result($pro,$i,"location"); ?></div></td>
<td align="left" bgcolor="#F0FAFF"><div align="left">&nbsp;<?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>&nbsp;</p>
<p>&nbsp;</p></th>
</tr>
</table></td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td><div align="center">
</div>

</td>
</tr>
</table>
</div>
</form>
</body>

</html>

Date : 2010-05-29 15:42:28 By : kerb
 

 

No. 27



โพสกระทู้ ( 71 )
บทความ ( 0 )



สถานะออฟไลน์


มันก็ยังแก้ไม่ได้อยู่ดี มันยัง error แบบเดิมเลยค่ะพี่ ขอโทษทีหายไปหลายวันพอดีติดอบรมเป็นอาทิตย์
Date : 2010-06-04 08:50:47 By : kabton_hok
 

 

No. 28

Guest


ต้องแก้ตาม 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
 

 

No. 29



โพสกระทู้ ( 71 )
บทความ ( 0 )



สถานะออฟไลน์


ขอบคุณมากนะค่ะ ได้แล้วคะ +1
Date : 2010-06-04 12:07:27 By : kabton_hok
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : error ช่วยดูหน่อยนะ Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ FTP| ใส่แถวของตาราง ใส่คอลัมน์ตาราง| ตัวยก ตัวห้อย ตัวพิมพ์ดีด| ใส่โค้ด ใส่การอ้างถึงคำพูด| ใส่ลีสต์
smiley for :lol: smiley for :ken: smiley for :D smiley for :) smiley for ;) smiley for :eek: smiley for :geek: smiley for :roll: smiley for :erm: smiley for :cool: smiley for :blank: smiley for :idea: smiley for :ehh: smiley for :aargh: smiley for :evil:
Insert PHP Code
Insert ASP Code
Insert VB.NET Code Insert C#.NET Code Insert JavaScript Code Insert C#.NET Code
Insert Java Code
Insert Android Code
Insert Objective-C Code
Insert XML Code
Insert SQL Code
Insert Code
เพื่อความเรียบร้อยของข้อความ ควรจัดรูปแบบให้พอดีกับขนาดของหน้าจอ เพื่อง่ายต่อการอ่านและสบายตา และตรวจสอบภาษาไทยให้ถูกต้อง

อัพโหลดแทรกรูปภาพ

Notice

เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ
อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง

   
  เพื่อความปลอดภัยและการตรวจสอบ กระทู้ที่แทรกไฟล์อัพโหลดไฟล์จากที่อื่น อาจจะถูกลบทิ้ง
 
โดย
อีเมล์
บวกค่าให้ถูก
<= ตัวเลขฮินดูอารบิก เช่น 123 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)





ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2025 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่