ผมแบ่งหน้าไม่ได้ ต้องทำยังไงครับ

ถาม-ตอบ แนะนำไอเดียว โค้ดตัวอย่าง แนวทาง วิธีแก้ปัญหา ผมแบ่งหน้าไม่ได้ ต้องทำยังไงครับ

ผมแบ่งหน้าไม่ได้ ต้องทำยังไงครับ
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:AppServwwwcomindex.php on line 99





<!DOCTYPE html>
<img src="img/fix.png" width="100%" />
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="stylesheet" type="text/css" href="test/index.php_files/main.css">
		<link rel="stylesheet" type="text/css" href="test/index.php_files/bootstrap.css">
		<link rel="stylesheet" type="text/css" href="test/index.php_files/jquery-ui-1.8.16.custom.css">
		<script type="text/javascript" src="test/index.php_files/jquery-1.6.2.min.js.download"></script>
		<script type="text/javascript" src="test/index.php_files/jquery-ui-1.8.16.custom.min.js.download"></script>
		 <link href="css/simple-sidebar.css" rel="stylesheet">

    </head>

	<?php include 'db.php';?>
<?php


$strSQL = "SELECT * FROM fix   order  by date DESC";
$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
$Num_Rows = mysql_num_rows($objQuery);
$Per_Page = 2;   // Per Page

$Page = $_GET["Page"];
if(!$_GET["Page"])
{
	$Page=1;
}

$Prev_Page = $Page-1;
$Next_Page = $Page+1;

$Page_Start = (($Per_Page*$Page)-$Per_Page);
if($Num_Rows<=$Per_Page)
{
	$Num_Pages =1;
}
else if(($Num_Rows % $Per_Page)==0)
{
	$Num_Pages =($Num_Rows/$Per_Page) ;
}
else
{
	$Num_Pages =($Num_Rows/$Per_Page)+1;
	$Num_Pages = (int)$Num_Pages;
}

$strSQL .=" order  by fix_id ASC LIMIT $Page_Start , $Per_Page";
$objQuery  = mysql_query($strSQL);
?>


    <body bgcolor="#ff0000" style="background: url(&#39;images/background-dot.gif&#39;);" onload="$(&#39;#username&#39;).focus();">
        <div class="header"><div class="banner"></div>
		
		
		
		</div>
        <div class="container">
            <div class="rightside-login shadow smooth">
                <h2 style="padding: 0 10px;">เข้าสู่ระบบ</h2>
                <hr>
                <form name="form1" method="post" action="check_login.php">
                    <table>
                        <tbody><tr>
                            <td width="100" align="right">Username:</td>
                            <td><input name="login_user" placeholder="username" type="text" id="login_user"></td>
                        </tr>
                        <tr>
                            <td align="right">Password:</td>
                            <td><input name="login_pass" placeholder="password" type="password" id="login_pass"></td>
                        </tr>
                        <tr>
                            <td colspan="2" align="right">
                                <span id="rs_login" class="alert-msg"></span>&nbsp;&nbsp;
                                <input type="submit" class="btn btn-primary" name="Submit" value="Login">
                            </td>
                        </tr>
                    </tbody></table>
                </form>
            </div>
            <div class="leftside-login shadow smooth">
            		<div class="row">
				<div class="col-md-12">






							<table bgcolor="#F0F8FF" border="1" class="table table-hover">
     <tr bgcolor="#87CEFA">

									<th width="20%"><center>ชื่อ-สกุล</th>
									<th width="30%"><center>แจ้งเรื่อง</th>
									<th width="20%"><center>ประเภทอุปกรณ์</th>
									<th width="10%"><center>สถาะนะ</th>
									<th width="15%"><center>วันที่-เวลา</th>
	  </tr>
    <?
    while($objResult = mysql_fetch_array($objQuery))
    {
    ?>
  <tr>
 <td><center><?=$objResult["name1"];?> &nbsp; <?=$objResult["name2"];?></td>
 <td>
	<?
						$p1 = $objResult['fix_p1'];
							switch($p1)
							{
							case "ฟอร์แมตเครื่องและลงระบบปฏิบัติการ":
							$p1 = "ฟอร์แมตเครื่องและลงระบบปฏิบัติการ"."<br>";
							break;
							case "0":
							$p1 = "";
							break;
							}

						$p2 = $objResult['fix_p2'];
							switch($p2)
							{
							case "2":
							$p2 = "อัพเดทแอนตี้ไวรัส สแกน/กำจัดไวรัส"."<br>";
							break;
							case "0":
							$p2 = "";
							break;
							}


						$p4 = $objResult['fix_p4'];
							switch($p4)
							{
							case "กู้ข้อมูลจากกสื่อจัดเก็บข้อมูล":
							$p4 = "กู้ข้อมูลจากกสื่อจัดเก็บข้อมูล" ."<br>";
							break;
							case "0":
							$p4 = "";
							break;
							}


						$p5 = $objResult['fix_p5'];
							switch($p5)
							{
							case "ซ่อมบำรุงอุปกรณ์คอมพิวเตอร์":
							$p5 = "ซ่อมบำรุงอุปกรณ์คอมพิวเตอร์" ."<br>";
							break;
							case "0":
							$p5 = "";
							break;
							}


						$p6 = $objResult['fix_p6'];
							switch($p6)
							{
							case "ลงโปรแกรมคอมพิวเตอร์เพิ่มเติม":
							$p6 = "ลงโปรแกรมคอมพิวเตอร์เพิ่มเติม" ."<br>";
							break;
							case "0":
							$p6 = "";
							break;
							}


						$p7 = $objResult['fix_p7'];
							switch($p7)
							{
							case "อินเตอร์เน็ต /แลน":
							$p7 = "อินเตอร์เน็ต /แลน" ."<br>";
							break;
							case "0":
							$p7 = "";
							break;
							}
	echo  $p1.$p2.$p4.$p5.$p6.$p7.$objResult["fix_p8"];


	?>



<?php
$data_value="";
$css_class="";
if($objResult["status"]==1){
    $data_value="รอคิว";
    $css_class="mystyle1";
}elseif ($objResult["status"]==2) {
    $data_value = "กำลังซ่อม";
    $css_class = "mystyle2";
}elseif ($objResult["status"]==3) {
    $data_value = "รอรับคืน";
    $css_class = "mystyle2";
}else{
    $data_value = "เสร็จสิ้น";
}
?>


 </td>
 <td><center>
          <?
          $t1 = $objResult['fix_t1'];
            switch($t1)
            {
            case "คอมพิวเตอร์ PC":
            $t1 = "คอมพิวเตอร์ PC"."<br>";
            break;
            case "0":
            $t1 = "";
            break;
            }

          $t2 = $objResult['fix_t2'];
            switch($t2)
            {
            case "Notebook":
            $t2 = "Notebook"."<br>";
            break;
            case "0":
            $t2 = "";
            break;
            }


          $t3 = $objResult['fix_t3'];
            switch($t3)
            {
            case "จอมอนิเตอร์":
            $t3 = "จอมอนิเตอร์" ."<br>";
            break;
            case "0":
            $t3 = "";
            break;
            }


          $t4 = $objResult['fix_t4'];
            switch($t4)
            {
            case "Printer":
            $t4 = "Printer" ."<br>";
            break;
            case "0":
            $t4 = "";
            break;
          }

          	echo  $t1.$t2.$t3.$t4.$objResult['fix_t6'];
          ?>


 </td>
  <td class="<?=$css_class?>"><center><?=$data_value?> </td>




 <td><center><?=$objResult["date"];?></td>
  </tr>


	<?
	}
	?>


	</table>
	<center>
Total <?= $Num_Rows;?> Record : <?=$Num_Pages;?> Page :
<?
if($Prev_Page)
{
	echo " <a href='$_SERVER[SCRIPT_NAME]?Page=$Prev_Page'><< Back</a> ";
}

for($i=1; $i<=$Num_Pages; $i++){
	if($i != $Page)
	{
		echo "[ <a href='$_SERVER[SCRIPT_NAME]?Page=$i'>$i</a> ]";
	}
	else
	{
		echo "<b> $i </b>";
	}
}
if($Page!=$Num_Pages)
{
	echo " <a href ='$_SERVER[SCRIPT_NAME]?Page=$Next_Page'>Next>></a> ";
}
mysql_close();
?>

 </center>
	</div>
			</div>
		</div>








                    </div>
                </div>
            </div>
        </div>
        <div class="footer">Copyright © 2017 <a href="http://comcenter.cpru.ac.th/">ศูนย์เทศโนโลยีสารสนเทศ มหาวิทยาลัยราชภัฏชัยภูมิ</a> All Rights Reserved.</div>
    


</body></html>


Trayloveza 202.29.51.xxx 19-01-2017 10:24:23

คำแนะนำ และการใช้งาน

สมาชิก กรุณา ล็อกอินเข้าระบบ เพื่อตั้งคำถามใหม่ หรือ ตอบคำถาม สมาชิกใหม่ สมัครสมาชิกได้ที่ สมัครสมาชิก


  • ถาม-ตอบ กรุณา ล็อกอินเข้าระบบ
  • เปลี่ยน


    ( หรือ เข้าใช้งานผ่าน Social Login )

 ความคิดเห็นที่ 1
ดูเนื้อหานี้เป็นแนวทาง

แนวทาง การค้นหาจาก หลายรูปแบบ และแบ่งหน้า อย่างง่าย 


ninenik 183.88.39.xxx 19-01-2017






เว็บไซต์ของเราให้บริการเนื้อหาบทความสำหรับนักพัฒนา โดยพึ่งพารายได้เล็กน้อยจากการแสดงโฆษณา โปรดสนับสนุนเว็บไซต์ของเราด้วยการปิดการใช้งานตัวปิดกั้นโฆษณา (Disable Ads Blocker) ขอบคุณครับ