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,027

HOME > PHP > PHP Forum > สอบถามปัญหา Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource ปัญหาเดิมๆ



 

สอบถามปัญหา Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource ปัญหาเดิมๆ

 



Topic : 122838



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



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




11
Code (PHP)
<?
include "sessionuser.php";
 include "../include/connect.php";
$k = $_SESSION["sess_id"];
 $sql = "update send_detail set open='1' where send_id='$_GET[send_id]' and user_id = $k ";
 $result = mysql_query($sql);  // ประมวลผลคำสั่ง sql ที่มาจาก $sql
if($result)
{
 
?>
<!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=windows-874" />
<script language="javascript" src="../include/time.js">
</script>
<script language="javascript" src="../include/1.js">
</script>
<title>ระบบหนังสือเวียน</title>
<link rel="stylesheet" type="text/css" href="menu_user.css">
<style type="text/css">
<!--
A:link {COLOR: #000000; TEXT-DECORATION: none} 
A:visited {COLOR: #000000; TEXT-DECORATION: none} 
A:hover {COLOR: #FF0000; TEXT-DECORATION: underline} 

.style4 {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	color: #FFFFFF;
}
.style12 {
	font-size: 13px
}
.style15 {color: #0000FF}
.style17 {color: #0000FF; font-size: 14px; }
.style24 {
	color: #0000FF;
	font-size: 14px;
}
-->
</style>
</head>
<body bgcolor="#999999" leftmargin="0" topmargin="0" >
 <table width="800" height="737" border="0" cellspacing="0" align="center" CELLPADDING=0 > <!--  start table 1 -->
<tr>
    <td width="786" height="198" background="../images/head_02.jpg"></td>
   </tr>
   <tr>
     <td width="786" height="26"  ><? include "menu_user.php"?></td>							 
   
    <tr>
		<td width="786" height="413" align="center">
                 <table width="800" height="412"  border="0" cellpadding="0" cellspacing="0"><!-- start table 2 -->
						 <tr> 
							 <th width="18" bgcolor="#DBDBDB" scope="col">&nbsp;</th>
							<th width="191" align="center" valign="top" bgcolor="#DBDBDB" scope="col">   
				        <table width="175" border="0">
                          <tr align="left">
    <td height="28" colspan="2">&nbsp;</td>
  </tr>
  <tr align="left">
    <td height="35" colspan="2"><span class="style24">Main Menu</span><br>
      <hr></td>
    </tr>
  <tr>
    <td width="34" height="25" align="right"><img src="../images/5_06.GIF" /></td>
    <td width="156" align="left"><a href="user_book_in.php">หนังสือเวียนเข้า</a></td>
  </tr>
  <tr>
    <td height="24" align="right"><img src="../images/5_06.GIF" /></td>
    <td align="left">  <a href="user_book_out.php">หนังสือเวียนออก</a></td>
  </tr>
  <tr>
    <td height="26" align="right"><img src="../images/5_06.GIF" /></td>
    <td align="left">  <a href="user_send.php">ส่งหนังสือเวียน</a></td>
  </tr>
  <tr>
    <td height="26" align="right"><img src="../images/5_06.GIF" /></td>
    <td align="left"> 	 <a href="user_search_book.php">ค้นหาหนังสือเวียน</a></td>
  </tr>
   <tr>
    <td height="26" align="right"><img src="../images/5_06.GIF" /></td>
    <td align="left"> 	 <a href="user_check_approve.php">ตรวจสอบสถานะ</a></td>
  </tr>
 <tr>
    <td height="46" colspan="2" align="left" valign="top"><p class="style22">.</p>      </td>
    </tr>
  <tr>
    <td height="42" colspan="2" align="left" valign="top"><span class="style24">Hello User</span><br>
      <hr></td>
  </tr>
  <tr>
    <td height="33" colspan="2" align="center" valign="top">
      <? 

 include "../include/connect.php";
$k = $_SESSION["sess_id"];
$sql = "select * from user , position  where user.user_id= $k and user.position_id = position.position_id  ";
mysql_query("set names tis620");
$result = mysql_query($sql);
$data = mysql_fetch_array($result);

						echo "<B>  $data[user_fname]&nbsp;&nbsp; $data[user_surname] <br><br> $data[position_detail]";
?>    </td>
  </tr>
  <tr>
    <td height="135" colspan="2" align="center" valign="middle"><img src="../pic/<?=$data[user_pic]?>" width="100" height="100" border="2" bordercolor="#FFFFFF" /></td>
  </tr>
  <tr>
    <td height="25" colspan="2" align="center" valign="middle"> <a href="../logout.php" class="style23 style12"><font color="#FF0000" >ออกจากระบบ </font> </a></td>
  </tr>
  <tr>
    <td height="25" colspan="2" align="center" valign="middle">&nbsp;</td>
  </tr>
</table>		<br >  <br ><br > 				</th>
						<th width="11" bgcolor="#DBDBDB" scope="col">&nbsp;</th>
					   <td width="580" align="center" valign="top" bgcolor="#FFFFFF" scope="col">
   <br >	
									<br >	<br >
								<fieldset style="border:2px  double #33CCFF; padding:10; width:400px; background-color:#78BCE0 "><br ><!-- start fieldset 3 -->
 <?
 include "../include/connect.php";
$a = $_SESSION["sess_id"];
$sql="select * from book , send ,send_detail , user , typebook where send_detail.user_id = $a and send_detail.send_id = send.send_id and send.book_id = book.book_id and send.user_id = user.user_id and book.typebook_id = typebook.typebook_id and send.send_id = '$_GET[send_id]' ";
$result=mysql_query($sql);
$data=mysql_fetch_array($result);
if(!$result){ echo mysql_error(); }  
?>
<table width="332" height="406" border="0" cellpadding="0" cellspacing="0">
  <tr align="left">
    <td height="41" colspan="3" align="center"><span class="style17">รายละเอียดหนังสือเวียนเข้า<img src="../images/5_01.PNG" width="25" height="25" /></span></td>
    </tr>
  <tr>
    <td width="87" height="20" align="left"><span class="style15"></span></td>
    <td width="24" align="left">&nbsp;</td>
    <td width="213" align="left">&nbsp;</td>
  </tr>
  <tr>
    <td height="30" align="left"><span class="style15">เรื่อง</span></td>
    <td align="left">:</td>
    <td align="left"><?=$data[subject]?></td>
  </tr>
  <tr>
    <td height="30" align="left"><span class="style15">จาก</span></td>
    <td align="left">:</td>
    <td align="left"><?= $data[user_fname].'&nbsp;&nbsp;'.$data[user_surname]?></td>
  </tr>
  <tr>
    <td height="30" align="left" ><span class="style15">ส่งเมื่อ</span></td>
    <td align="left">:</td>
    <td align="left"><?=$data[send_date].'&nbsp;&nbsp;'.$data[send_time]?></td>
  </tr>
  <tr>
    <td height="30" align="left"><span class="style15">ไฟล์แนบ</span></td>
    <td align="left">:</td>
    <td align="left"><?
	$user_folder = $data[user_id];
	$a = $data[send_date];

$year = substr($a, -5,-1);
$month = substr($a, 4,-6);

$file_name=$data['book_name'];
 echo "<a href=\"../pdf/$user_folder/$year/$month/$file_name\" TARGET='_blank'><font color= '#OOFFOO' >	$file_name </a>" ; 
 ?> </td>
  </tr>
  <?
  if ($data[vision] == 1){
  ?>
  <tr>
    <td height="30" align="left"><span class="style15">ไฟล์ลับ</span></td>
    <td align="left">:</td>	
<?
$name_book=$data[book_name];
?>
<td align="left">

<form action="decode.php?name_book=<?=$name_book?>&user_send_id=<?=$data[send_id]?>" method="post" target="_blank">

 <input type="text" name="key" id="key" style ="width:70px;" >&nbsp;&nbsp;&nbsp;
 <input name="" type="submit" value=" OK " />
</form>

 </td>
  </tr>
  <?
  }
  ?>
  
  
  <tr>
    <td height="67" align="left" valign="top"><span class="style15"><br>
      รายละเอียด</span></td>
    <td align="left" valign="top"><br> :</td>
    <td align="left" valign="top"><br><?=$data[book_detail]?></td>
  </tr>
    <tr>
    <td height="28" align="left" valign="top">&nbsp;</td>
    <td align="left" valign="top">&nbsp;</td>
    <td align="left" valign="top">
  <?
  if($data[approve]==1){
  ?>
<img src="../images/apply_f2.png" /> <a href="approve.php?approve=2&send_id=<?=$data[0]?>">เข้าร่วม</a> &nbsp;&nbsp;&nbsp;<img src="../images/cancel_f2.png" /><a href="approve.php?approve=3&send_id=<?=$data[0]?>">ไม่เข้าร่วม</a>
 
  <? }
  else if ($data[approve]==2)
  {
  echo "สถานะการเข้าร่วม : <font color='red' >เข้าร่วมแล้ว </font>";
  }else if ($data[approve]==3){
  echo "สถานะการเข้าร่วม :<font color='red' >ไม่เข้าร่วมแล้ว </font>";
  }else{
  echo " ";
  }
   ?> 
     </td>
  </tr>
  <tr>
    <td height="30" align="left">&nbsp;</td>
    <td align="left">&nbsp;</td>
    <td align="right"><img src="../images/20_06.PNG" width="100" height="100" /></td>
  </tr>
</table>

									
								<!--  END table 3 -->
		           

								<!--  END table 3 -->
		                        <br > 	<br > 
						</fieldset> <!-- END fieldset 3 -->   
                        <br ><br >					</td>
				</tr>
   </table><!-- END table 2 -->           </tr>
	<tr>
			<td width="786" height="100" background="../images/head_05.jpg" >
					  <div align="right">
					    <p>&nbsp;</p>
					    <? include "footer.php"?>
					  </div>			 </td>
    </tr>
</table>
<!-- END table 3 -->	
</body>
</html>
<?
}
else
{
echo "<CENTER>แก้ไขข้อมูลไม่ได้</CENTER>";
echo "<script>setTimeout(\"location='user.php'\",500);</script>";
}
?>




Tag : PHP, MySQL, HTML/CSS, JavaScript, Ajax, jQuery







Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2016-05-10 11:45:49 By : settachai View : 703 Reply : 1
 

 

No. 1



โพสกระทู้ ( 4,706 )
บทความ ( 8 )



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


https://www.thaicreate.com/php/forum/095986.html








ประวัติการแก้ไข
2016-05-10 13:36:51
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2016-05-10 13:36:39 By : mr.v
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : สอบถามปัญหา Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource ปัญหาเดิมๆ
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ 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 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)







Exchange: นำเข้าสินค้าจากจีน, Taobao, เฟอร์นิเจอร์, ของพรีเมี่ยม, ร่ม, ปากกา, power bank, แฟลชไดร์ฟ, กระบอกน้ำ

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