รบกวนช่วยดูทีครับ Warning: mysql_fetch_array()... เฉพาะบนเซิฟ
Code (PHP)
<?php
include'include/master.php';
include'include/condb.php';
?>
<!DOCTYPE html>
<html lang="en"><!-- InstanceBegin template="/Templates/Fahsaung.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<meta charset="utf-8">
<!-- Title here -->
<!-- InstanceBeginEditable name="doctitle" -->
<title>ศูนย์ไตเทียมฟ้าสั่ง</title>
<!-- InstanceEndEditable -->
<!-- Description, Keywords and Author -->
<meta name="description" content="Your description">
<meta name="keywords" content="Your,Keywords">
<meta name="author" content="ResponsiveWebInc">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Styles -->
<!-- Bootstrap CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- Flex Slider CSS -->
<link href="css/flexslider.css" rel="stylesheet">
<!-- Pretty Photo -->
<link href="css/prettyPhoto.css" rel="stylesheet">
<!-- Font awesome CSS -->
<link href="css/font-awesome.min.css" rel="stylesheet">
<!-- Custom CSS -->
<link href="css/style.css" rel="stylesheet">
<!-- Color Stylesheet - orange, blue, pink, brown, red or green-->
<link href="css/purple.css" rel="stylesheet">
<!-- Favicon -->
<link rel="shortcut icon" href="img/favicon/favicon.png">
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<style type="text/css">
td {
padding:3px;
}
@font-face {
font-family: "Tahoma";
font-size: 12px;
}
</style>
<!-- InstanceBeginEditable name="head" -->
<?php
ini_set('display_errors', 1);
error_reporting(~0);
$strKeyword = null;
if(isset($_POST["txtKeyword"]))
{
$strKeyword = $_POST["txtKeyword"];
}
?>
<!-- InstanceEndEditable -->
</head>
<body>
<!-- Header starts -->
<?php head(); ?>
<!-- Header ends -->
<!-- Navigation Starts -->
<?php nav(); ?>
<!--/ Navigation Ends -->
<div class="content">
<div class="container">
<div class="row">
<div class="col-md-12">
<!-- InstanceBeginEditable name="Content" -->
<?php
$sql = "SELECT Name FROM dz WHERE Name LIKE '%".$strKeyword."%' ";
$query = mysqli_query($conn,$sql);
?>
<h2>Dialyzer</h2>
<form name="frmSearch" method="post" action="<?php echo $_SERVER['SCRIPT_NAME'];?>">
<table width="450">
<tr>
<td width="58">คำค้น</td>
<td width="132"><input class="form-control" style="width:150px;" type="search" name="txtKeyword" value="<?php echo $strKeyword;?>"></td>
<td width="82"><button type="submit" class="btn btn-default" aria-label="Left Align"> <span class="glyphicon glyphicon-search" aria-hidden="true"> ค้นหา</span> </button></td>
<td width="188"><button type="button" class="btn btn-success" onClick ="window.location = 'add-dz.php'" aria-label="Left Align"> <span class="glyphicon glyphicon-plus" aria-hidden="true"> Dialyzer</span> </button></td>
</tr>
</table>
</form>
<table width="300" border="1">
<tr>
<td height="38" align="center" bgcolor="#0099FF"><font size="+1" color="#FFFFFF">Dialyzer</font></td>
<td width="80" align="center" bgcolor="#0099FF"><font color="#FFFFFF">แก้ไข/ลบ</font></td>
</tr>
<tr>
<?php
while($result=mysqli_fetch_array($query,MYSQLI_ASSOC))
{
?>
<td width="238"><?php echo $result["Name"];?></td>
<td align="center"><div class="btn-group" role="group" aria-label="...">
<button type="button" class="btn btn-warning btn-sm" onclick="location.href='add-dz.php'" aria-label="Left Align"> <span class="glyphicon glyphicon-pencil" aria-hidden="true"></span> </button>
<button type="button" class="btn btn-danger btn-sm" aria-label="Left Align"> <span class="glyphicon glyphicon-remove" aria-hidden="true"></span> </button>
</div></td>
</tr>
<?php
}
?>
</table>
<?php
$conn->close();
?>
<!-- InstanceEndEditable -->
<!-- Service ends -->
</div>
</div>
</div>
</div>
<!-- Footer -->
<?php foot(); ?>
<!--/ Footer -->
<!-- Scroll to top -->
<span class="totop"><a href="#"><i class="fa fa-angle-up"></i></a></span>
<!-- Javascript files -->
<!-- jQuery -->
<!-- InstanceBeginEditable name="EditRegion4" -->
<!-- InstanceEndEditable -->
<!-- Bootstrap JS -->
<script src="js/bootstrap.min.js"></script>
<!-- Isotope, Pretty Photo JS -->
<script src="js/jquery.isotope.js"></script>
<script src="js/jquery.prettyPhoto.js"></script>
<!-- Support Page Filter JS -->
<script src="js/filter.js"></script>
<!-- Flex slider JS -->
<script src="js/jquery.flexslider-min.js"></script>
<!-- Respond JS for IE8 -->
<script src="js/respond.min.js"></script>
<!-- HTML5 Support for IE -->
<script src="js/html5shiv.js"></script>
<!-- Custom JS -->
<script src="js/custom.js"></script>
</body>
<!-- InstanceEnd --></html>
Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in /home/ditruz/domains/ditruz.net/public_html/fahsaung/dz.php on line 104
มีปัญหาเฉพาะบนเซิฟครับ ทดสอบบนclient ไม่เกิดปัญหาTag : PHP
Date :
2017-04-04 22:19:58
By :
NP-Carbon
View :
723
Reply :
4
แทรก echo mysqli_error($conn); ที่บรรทัด 103 ไฟล์
/home/ditruz/domains/ditruz.net/public_html/fahsaung/dz.php
จะทราบว่า error อะไรครับ
Date :
2017-04-04 22:46:45
By :
num
ขอบคุณมากครับ ได้แล้วครับ ชื่อตารางไม่ตรงกัน สงสัยแค่ว่ามันเป็น Case sensitive ด้วยหรอครับ ชื่อตารางเนี่ย
Date :
2017-04-05 11:12:18
By :
NP-Carbon
บน linux server ส่วนใหญ่จะ case sensitive ครับ
Date :
2017-04-05 12:00:00
By :
num
อ่ออออ....มันเป็นแบบนี้นี่เอง
Date :
2017-04-05 14:00:40
By :
NP-Carbon
Load balance : Server 03