แก้ยังไงครับ 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 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> <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"> </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
T T
Date :
2013-03-12 18:05:18
By :
cookiephp
Load balance : Server 00