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 in C:\AppServ\www\editSection.php on line 25 Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\AppServ\www\editSection.php on li



 

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\AppServ\www\editSection.php on line 25 Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\AppServ\www\editSection.php on li

 



Topic : 073161

Guest




Code (PHP)
<?
session_start();
include "checksession.php";
include "ConnectionDb.php";
?><?

$page=$_GET['page'];
if($page==""){
	$page=1;
}
$each=10;

$sql_cat= "SELECT  *  FROM  tbsection";
$result_cat  = mysql_query($sql_cat);
$totals = mysql_num_rows($result_cat);

$totalpages=ceil ($totals/$each);
$totals = ($page-1)*$each;

$sql_cat = "SELECT * FROM tbsection ORDER BY sectioned DESC limit $goto,$each";
$result_cat = mysql_query ($sql_cat);

$sq ="SELECT MAX (sectionid) AS sectioned FROM tbsection";
$result=mysql_query($sql);
$dbarr=mysql_fetch_array($result);
  If  ($dbarr)  {
       $total=$dbarr['sectionid' ]+1;
       If  (strLen($total)== "1" ) {
            $total= "0"  .$total;
}  else  {
        $total= $total;
     }
}  else  {
    $total= $ectionid  ;
}
?>

<table width="700" border="0"  align="center"  cellpadding="1"  cellspacing="1"
Bordercolordark="#FFFFFF">
   <tr>
      <td colspan="5" bgcolor="#FFCCCC"  align="center"><b>รายการข้อมูลประเภทชุด</b></td>
</tr>
<tr bgcolor="#FFFFCC">
      <td width="169" align="center">รหัสประเภทชุด</td>
      <td width="320" align="center">ชื่อประเภท</td>
      <td width="120" align="center">แก้ไข</td>
      <td width="190" align="center">ลบ</td>
</tr>
<?
While  ($dbarr_cat = mysql_fetch_array($result_cat)) {
?>
      <tr bgcolor="#F4F4F4">

<td align="center"><?=$dbarr_cat['sectionid'];?></td>
<td><?=$dbarr_cat['sectionname'];?></td>
<td align ="center">[ <a href="main.php?menu=1&do=edit&id=<?=$dbarr_cat['sectionid'];
?>">แก้ไข</a> ]</td>
        <td align= "center">[ <a href="main.php?menu=1&do=delete&id=<?=$dbarr_cat
['sectionid'];?>">ลบ</a> ]</td>
   </tr>
<?
}
?>
    <tr bgcolor="#F4F4F4" >
        <td colspan="4" align="right">มีทั้งหมด <?=$totals;?>  รายการ :
        <?
        If ($totalpages>1)  {
            For ($i=1;$i<=$totalpages;$i++)  {
      If  ($i == $page) {
           echo "<b> หน้า$page</b>";
       }   else {
            echo "I <a href =\"main.php?menu=1&do=add&page=$i\">$i</a>&nbsp;";
        }
      }
   }
  ?>
  </td>
</tr>
</table>

<?
$sql= "SELECT * FROM tbsection WHERE sectioned ='$_REQUEST[id]'" ;
$result=mysql_query($sql);
$dbarr=mysql_fetch_array($result);
?>

<form name="frmEdit" method="post"  action="main.php?menu=1&do=edit&doding=edit">
<table width ="300" border="0" align="center" cellpadding="0" cellspacing="0"
Bordercolordark="#FFFFFF">
     <tr>
        <td bgcolor="#FFCCCC" align="center"><b>::แก้ไขประเภทชุด:: <?=$dbarr['sectionid'];?>
</b><td>
    </tr>
  <tr>
 <td>
 <table width="700" border="0"  align="center" cellpadding="5" cellspacing="1">
 <tr bgcolor="#F4F4F4">
<td width="25%" align="right">รหัสประเภทชุด</td>
<td width="25%" $=dbarr['sectionid'];?></td>
<td width="15%">ชื่อชุด</td>
<td width="35%"><input type="text"  name="stypeName" value="<?=$dbarr['sectionname'];?>"></td>
</tr> 
<tr bgcolor="#F4F4F4">
<td colspan="6" align=" center">

<input   type="hidden" name="id_edit"  value="<?=$dbarr['sectiondi'];?>">
<input  type="submit" name="button"  value="แก้ไข">
<input  type="reset"name="reset"  value="ล้างข้อมูล">
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>




Tag : PHP, MySQL







Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2012-02-03 11:35:35 By : hhgolfhh View : 910 Reply : 2
 

 

No. 1



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



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

$sq ="SELECT MAX (sectionid) AS sectioned FROM tbsection"; <<<<<<<<< ชื่อตัวแปรผิด ลืมใส่ l
$result=mysql_query($sql); <<<<<<<<<<< เรียก $sql ซึ่งด้านบนมันแค่ $sq เป็นคนละตัวกัน






แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-02-03 14:20:26 By : iamatomix
 


 

No. 2



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



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


warning มันบอกว่า ข้อมูลที่คุณใส่มาในฟังชัน mysql_fetch_array() มันไม่มีค่า หรือ ให้ค่าไม่ถูกต้อง

พอไล่โค้ดขี้นไปก็จะเจอปัญหาอย่างที่ คุณ DJ.Atomix แนะนำไว้ครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-02-04 05:30:02 By : ขนมหม้อแกง
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\AppServ\www\editSection.php on line 25 Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\AppServ\www\editSection.php on li
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ 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 00
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 อัตราราคา คลิกที่นี่