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_object(): supplied argument is not a valid MySQL result resource in



 

แก้ยังไงครับ Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in

 



Topic : 092298



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



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




<?
include("./connect.php");
session_start();
if(!isset($user_id)){
$effect_index="";
}else{
$effect_index="สวัสดีครับ คุณ <b>".$user_id."</b>";
}


$sql="select * from rent inner join water_elec,room,room_type on(water_elec.rent_id=rent.rent_id) AND (water_elec.room_id=room.room_id) AND (room.room_type=room_type.type_id) where water_elec.rent_id='$rent_id'";


$result=mysql_query($sql);

$chk=mysql_num_rows($result);
if($chk>0){
$status="หาข้อมูลพบ";
}else{
$status="";
}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">

<!-- Recommended XHTML-Editor: HTML-Kit 292 (Freeware) -->
<!-- http://www.chami.com/html-kit/download/ -->

<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-11" />
<meta name="description" content="Your description goes here" />
<meta name="keywords" content="your,keywords,goes,here" />
<meta name="author" content="ระบบเช่าอพาร์ทเม้น" />
<link rel="stylesheet" type="text/css" media="screen,projection" href="./css/style_screen.css" />
<link rel="stylesheet" type="text/css" media="print" href="./css/style_print.css" />
<title>ระบบเช่าอพาร์ทเม้น</title>
</head>

<body>
<div class="page-container-1">

<?php include("./head.php"); ?>

<div><img class="img-header" src="./img/header.jpg" alt=""/></div>

<!-- Navigation Level 2 -->
<?php include("./menu_head.php"); ?>

<!-- Buffer after header -->
<div class="buffer"></div>

<!-- NAVIGATION -->
<!-- Navigation Level 3 -->
<?php include("./menu_left.php"); ?>

<!-- CONTENT -->
<div class="content1">

<!-- Page title -->



<div class="content1-pagetitle">ข้อมูลสำหรับผู้เช่า</div>
<TABLE cellSpacing=0 cellPadding=0 width=100%
border=0>
<TBODY>
<TR>
<TD width=6><IMG height=5
src="images/dx1.gif"
width=6></TD>
<TD
background="images/dx2.gif"><IMG
height=5
src="images/dx2.gif"
width=2></TD>
<TD width=8><IMG height=5
src="images/dx3.gif"
width=8></TD></TR>
<TR>
<TD
background="images/dx4.gif"><IMG
height=2
src="images/dx4.gif"
width=6></TD>
<TD vAlign=center height=76>
<DIV align=left>

<table width="98%" border="0" align="center" cellpadding="1" >
<tr>
<td height="45" colspan="5" align="left" class="style19">รายการค่าใช้จ่ายทั้งหมดของคุณ ที่ผ่านมา</td>
<!-- <td colspan="2" height="45" align="left" class="style9"><a href="add_room.php"><img src="./img/17_134.gif" width="24" height="24" border="0" align="absmiddle" /></a><span class="style12"> <a href="add_room.php"><font color="#000"> เพิ่มห้องใหม่ </font></a></span> </td> -->
</tr>
<tr>
<td width="5%" align="center" bgcolor="#7390da" class="style25">ลำดับ</td>
<td width="10%" align="center" bgcolor="#7390da" class="style25">เลขที่ใบเสร็จ</td>
<td width="10%" align="center" bgcolor="#7390da" class="style25">เลขที่ห้อง</td>
<td width="15%" align="center" bgcolor="#7390da" class="style25">ประจำเดือน</td>
<td width="10%" align="center" bgcolor="#7390da" class="style25">ผู้เช่า</td>
<td width="10%" align="center" bgcolor="#7390da" class="style25">ยอดชำระ</td>
<td width="10%" align="center" bgcolor="#7390da" class="style25">สถานะ</td>
</tr>
<?
$result=mysql_query($sql);
$x=1;
while($dd=mysql_fetch_object($result)){
$chk1=mysql_num_rows($result);

$price_elec=$dd->total_elec+$dd-> elecperunit ;
$price_water=$dd->total_water+$dd->waterperunit ;
$sum=($price_elec+$price_water)+$dd->price;
/*if($dd->status_payment=="on"){
$status=" <a href=\"pay1.php?waterelec_id=<?echo $dd->waterelec_id;?>\"
onmouseover=\"status='Remove Alias'; return true;\"
onmouseout=\"status=\''; return true;\"
onclick=\"return confirm('ยืนยันการชำระเงินหรือไม่?')\"> <img src=\"./images/payment.png\" border=\"0\"> </a>";
}else{
$status=" <a href='pay.php?waterelec_id=$dd->waterelec_id'> <img src=\"./images/services.png \" border=\"0\"> </a>";
// $status1=" <a href='list_mat.php?room_id=$dd->room_id'> <img src=\"./img/pag_bg_a.png\" border=\"0\"> </a>";
}
*/
if($dd->status_payment=='off'){
$sta="<font color='blue'>ชำระแล้ว</font>";
}else{
$sta="<font color='red'>ค้างชำระ</font>";
}

?>
<tr>
<td height="5" align="center" class="style17"><span class="style16">[<? Echo $x;?>] </span></td>
<td height="10" align="center" class="style17"><span class="style16"><? Echo $dd->waterelec_id;?></span></td>
<td height="20" align="left" class="style17"><span class="style16"><? Echo $dd->room_id ;?> </span></td>
<td height="30" align="left" class="style17"><span class="style16"><? Echo $dd->month_after;?> </span></td>
<td height="30" align="center" class="style17"><span class="style16"><? Echo $dd->rent_name;?> </span></td>
<td height="30" align="center" class="style17"><span class="style16"><? Echo number_format($sum,2);?> </span>
<td height="30" align="center" class="style17"><span class="style16"><? Echo $sta;?> </span>
<!-- </td>
<td height="30" align="center" class="style17"><span class="style16"> <a href="pay1.php?waterelec_id=<?echo $dd->waterelec_id;?>"
onmouseover="status='Remove Alias'; return true;"
onmouseout="status=''; return true;"
onclick="return confirm('ยืนยันการชำระเงินหรือไม่?')" > <img src="./images/payment.png" border="0"></a> </span></td>
<td height="30" align="center" class="style17"><a href="product_edit.php"><img src="../images/file.gif" width="15" height="14" border="0" /></a>&nbsp; <a href="showProducts.html?alias=yuy "
onmouseover="status='Remove Alias'; return true;"
onmouseout="status=''; return true;"
onclick="return confirm('คุณต้องการจะลบข้อมูลนี้ใช่หรือไม่?')"><img src="../images/11_11.gif" width="14" height="14" border="0" /></a></td> -->
</tr>

<?
$x++;
}
?>
<tr><td colspan='8' bgcolor="#7390da">&nbsp;</td></tr>
</table>

</DIV></TD>
<TD
background="images/dx5.gif"><IMG
height=1
src="images/dx5.gif"
width=8></TD></TR>
<TR>
<TD><IMG height=10
src="images/dx6.gif"
width=6></TD>
<TD
background="images/dx7.gif"><IMG
height=10
src="images/dx7.gif"
width=2></TD>
<TD><IMG height=10
src="images/dx8.gif"
width=8></TD></TR></TBODY></TABLE>

<hr>




</div>

<!-- SIDEBAR -->
<?php include("./menu_right.php");?>

<!-- FOOTER -->
<?php include("./footer.php");?>
</div>
</body>
</html>



Tag : PHP







Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2013-03-12 17:52:02 By : kitsanin099 View : 1081 Reply : 3
 

 

No. 1



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



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


แก้ยังไงครับ Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in C:\AppServ\www\apartment\user_data.php on line 107
<?
include("./connect.php");
session_start();
if(!isset($user_id)){
$effect_index="";
}else{
$effect_index="สวัสดีครับ คุณ <b>".$user_id."</b>";
}


$sql="select * from rent inner join water_elec,room,room_type on(water_elec.rent_id=rent.rent_id) AND (water_elec.room_id=room.room_id) AND (room.room_type=room_type.type_id) where water_elec.rent_id='$rent_id'";


$result=mysql_query($sql);

$chk=mysql_num_rows($result);
if($chk>0){
$status="หาข้อมูลพบ";
}else{
$status="";
}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">

<!-- Recommended XHTML-Editor: HTML-Kit 292 (Freeware) -->
<!-- http://www.chami.com/html-kit/download/ -->

<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-11" />
<meta name="description" content="Your description goes here" />
<meta name="keywords" content="your,keywords,goes,here" />
<meta name="author" content="ระบบเช่าอพาร์ทเม้น" />
<link rel="stylesheet" type="text/css" media="screen,projection" href="./css/style_screen.css" />
<link rel="stylesheet" type="text/css" media="print" href="./css/style_print.css" />
<title>ระบบเช่าอพาร์ทเม้น</title>
</head>

<body>
<div class="page-container-1">

<?php include("./head.php"); ?>

<div><img class="img-header" src="./img/header.jpg" alt=""/></div>

<!-- Navigation Level 2 -->
<?php include("./menu_head.php"); ?>

<!-- Buffer after header -->
<div class="buffer"></div>

<!-- NAVIGATION -->
<!-- Navigation Level 3 -->
<?php include("./menu_left.php"); ?>

<!-- CONTENT -->
<div class="content1">

<!-- Page title -->



<div class="content1-pagetitle">ข้อมูลสำหรับผู้เช่า</div>
<TABLE cellSpacing=0 cellPadding=0 width=100%
border=0>
<TBODY>
<TR>
<TD width=6><IMG height=5
src="images/dx1.gif"
width=6></TD>
<TD
background="images/dx2.gif"><IMG
height=5
src="images/dx2.gif"
width=2></TD>
<TD width=8><IMG height=5
src="images/dx3.gif"
width=8></TD></TR>
<TR>
<TD
background="images/dx4.gif"><IMG
height=2
src="images/dx4.gif"
width=6></TD>
<TD vAlign=center height=76>
<DIV align=left>

<table width="98%" border="0" align="center" cellpadding="1" >
<tr>
<td height="45" colspan="5" align="left" class="style19">รายการค่าใช้จ่ายทั้งหมดของคุณ ที่ผ่านมา</td>
<!-- <td colspan="2" height="45" align="left" class="style9"><a href="add_room.php"><img src="./img/17_134.gif" width="24" height="24" border="0" align="absmiddle" /></a><span class="style12"> <a href="add_room.php"><font color="#000"> เพิ่มห้องใหม่ </font></a></span> </td> -->
</tr>
<tr>
<td width="5%" align="center" bgcolor="#7390da" class="style25">ลำดับ</td>
<td width="10%" align="center" bgcolor="#7390da" class="style25">เลขที่ใบเสร็จ</td>
<td width="10%" align="center" bgcolor="#7390da" class="style25">เลขที่ห้อง</td>
<td width="15%" align="center" bgcolor="#7390da" class="style25">ประจำเดือน</td>
<td width="10%" align="center" bgcolor="#7390da" class="style25">ผู้เช่า</td>
<td width="10%" align="center" bgcolor="#7390da" class="style25">ยอดชำระ</td>
<td width="10%" align="center" bgcolor="#7390da" class="style25">สถานะ</td>
</tr>
<?
$result=mysql_query($sql);
$x=1;
while($dd=mysql_fetch_object($result))
$chk1=mysql_num_rows($result);

$price_elec=$dd->total_elec+$dd-> elecperunit ;
$price_water=$dd->total_water+$dd->waterperunit ;
$sum=($price_elec+$price_water)+$dd->price;
/*if($dd->status_payment=="on"){
$status=" <a href=\"pay1.php?waterelec_id=<?echo $dd->waterelec_id;?>\"
onmouseover=\"status='Remove Alias'; return true;\"
onmouseout=\"status=\''; return true;\"
onclick=\"return confirm('ยืนยันการชำระเงินหรือไม่?')\"> <img src=\"./images/payment.png\" border=\"0\"> </a>";
}else{
$status=" <a href='pay.php?waterelec_id=$dd->waterelec_id'> <img src=\"./images/services.png \" border=\"0\"> </a>";
// $status1=" <a href='list_mat.php?room_id=$dd->room_id'> <img src=\"./img/pag_bg_a.png\" border=\"0\"> </a>";
}
*/
if($dd->status_payment=='off'){
$sta="<font color='blue'>ชำระแล้ว</font>";
}else{
$sta="<font color='red'>ค้างชำระ</font>";
}

?>
<tr>
<td height="5" align="center" class="style17"><span class="style16">[<? Echo $x;?>] </span></td>
<td height="10" align="center" class="style17"><span class="style16"><? Echo $dd->waterelec_id;?></span></td>
<td height="20" align="left" class="style17"><span class="style16"><? Echo $dd->room_id ;?> </span></td>
<td height="30" align="left" class="style17"><span class="style16"><? Echo $dd->month_after;?> </span></td>
<td height="30" align="center" class="style17"><span class="style16"><? Echo $dd->rent_name;?> </span></td>
<td height="30" align="center" class="style17"><span class="style16"><? Echo number_format($sum,2);?> </span>
<td height="30" align="center" class="style17"><span class="style16"><? Echo $sta;?> </span>
<!-- </td>
<td height="30" align="center" class="style17"><span class="style16"> <a href="pay1.php?waterelec_id=<?echo $dd->waterelec_id;?>"
onmouseover="status='Remove Alias'; return true;"
onmouseout="status=''; return true;"
onclick="return confirm('ยืนยันการชำระเงินหรือไม่?')" > <img src="./images/payment.png" border="0"></a> </span></td>
<td height="30" align="center" class="style17"><a href="product_edit.php"><img src="../images/file.gif" width="15" height="14" border="0" /></a>&nbsp; <a href="showProducts.html?alias=yuy "
onmouseover="status='Remove Alias'; return true;"
onmouseout="status=''; return true;"
onclick="return confirm('คุณต้องการจะลบข้อมูลนี้ใช่หรือไม่?')"><img src="../images/11_11.gif" width="14" height="14" border="0" /></a></td> -->
</tr>

<?
$x++;
}
?>
<tr><td colspan='8' bgcolor="#7390da">&nbsp;</td></tr>
</table>

</DIV></TD>
<TD
background="images/dx5.gif"><IMG
height=1
src="images/dx5.gif"
width=8></TD></TR>
<TR>
<TD><IMG height=10
src="images/dx6.gif"
width=6></TD>
<TD
background="images/dx7.gif"><IMG
height=10
src="images/dx7.gif"
width=2></TD>
<TD><IMG height=10
src="images/dx8.gif"
width=8></TD></TR></TBODY></TABLE>

<hr>




</div>

<!-- SIDEBAR -->
<?php include("./menu_right.php");?>

<!-- FOOTER -->
<?php include("./footer.php");?>
</div>
</body>
</html>






แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-03-12 17:56:06 By : kitsanin099
 


 

No. 2



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

สมาชิกที่ใส่เสื้อไทยครีเอท

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

T T
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-03-12 18:05:18 By : cookiephp
 

 

No. 3



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

สมาชิกที่ใส่เสื้อไทยครีเอท

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

T T

https://www.thaicreate.com/php/forum/092260.html
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-03-12 18:05:59 By : cookiephp
 

   

ค้นหาข้อมูล


   
 

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