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 > โค้ดแบ่งหน้าค่ะ error และก็อยากให้ บรรทัดที่แบ่งมาอยู่ข้างบน มุมขวา ด้วย ต้องทำไงคะ



 

โค้ดแบ่งหน้าค่ะ error และก็อยากให้ บรรทัดที่แบ่งมาอยู่ข้างบน มุมขวา ด้วย ต้องทำไงคะ

 



Topic : 047719



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



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




question.php

Code (PHP)
<? include "include/config.php";?>
<? include "function/function_member.php";?>
<? include "function/function_webboard.php";?>
<? include "function/function_question.php";?>
<? include "function/page_func.inc.php";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel='stylesheet' type='text/css' href='css/indexStyle.css' media='all' />
<title>Untitled Document</title>
<style type="text/css">
<!--
a:link {
	color: #FFCC00;
}
-->
</style></head>

<body>
<div id="topBarDiv"></div>
<div id="wrapperDiv">
    <!-- start header-->
        <div id="headerDiv">
        
        </div> <!--end headerDiv-->
    <!--end header-->
    
    <!--start menu and search-->
        <div id="menuDiv">
		
		<table width="100%" border="0" cellspacing="0" cellpadding="0" class="menuTable">
          <tr>
            <td class="menu">
				<? include "menu.php";?>
			</td>
			</tr>
		</table>
		
        
        </div> <!--end menuDiv-->
    <!--end menu and search-->
    
    
    <!--start top content-->
    	<div id="wrapperTopContentDiv">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td valign="top" width="100">&nbsp; 
                </td>
                <td valign="top">
                  <div id="readNewsRightContentDiv">
                <p class="pReadNewsRightContentHeader">ชื่อห้อง </p>
                <p class="pReadNewsRightContentDate">..................................</p>
                <br>
				<div id="bodyContent">
					<table width="738" border="0" cellpadding="5" cellspacing="0" class="tableQuestion">
					  <tr>
    <td>&nbsp;</td>
    <td><div align="center"><h3>
	<? //if(isset($_SESSION["user"])){?>
	<a href="question_add.php?question=<?=$question?>">เพิ่มคำถาม</a>
	<? //}?>
	</h3>
    </div></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td width="470"><h3>คำถาม</h3></td>
    <td width="128"><div align="center"><h3>ผู้ตั้ง</h3></div></td>
    <td><div align="center"><h3>วันที่</h3></div></td>
  </tr>
  <? 
  $perpage=10;
  if(!isset($page)){
  $page=1;
  }
  list($result,$total)=question_view($question,$page,$perpage);
  while($row=mysql_fetch_array($result)){
  $date=split("-",$row["question_date"]);
  ?>
  <tr >
    <td ><a href="question_view.php?question=<?=$row["question_id"]?>" style="text-decoration:none; color:#003300;"><?=$row["question_topic"]?></a></td>
    <td><div align="center"><?=$row["question_name"]?></div></td>
    <td width="100"><div align="center"><?=$date[2]?>/<?=$date[1]?>/<?=$date[0]?></div></td>
  </tr>
 <? }?>
  <tr>
    <td colspan="3" align="right">      <?
	if($total>1){
	showPageQuestion($total,$page,$question);
	}
	?></td>
    </tr>
</table>
				</div>
     
                </div> 
                <br><br>
            	
                </td>		
				
              </tr>
            </table>
        </div> <!--end wrapperTopContentDiv-->
    <!-- end top content-->
    <div id="footerDiv">
    Copyright © 2001-2010 ivf All rights reserved. Telephone: 0108414736771, Fax: 025255544
    </div>
</div><!-- end wrapperDiv-->
</body>
</html>




ผลลัพท์

ผลลัพท์


question_view.php

<? include "include/config.php";?>
<? include "function/function_question.php";?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel='stylesheet' type='text/css' href='css/indexStyle.css' media='all' />
<title>Untitled Document</title>

</head>
<?
if($Submit!=null){

answer_insert($desc,$question,$name,$email);
}
?>
<body>
<div id="topBarDiv"></div>
<div id="wrapperDiv">



<!-- start header-->
<div id="headerDiv">

</div> <!--end headerDiv-->
<!--end header-->

<!--start menu and search-->
<div id="menuDiv">

<table width="100%" border="0" cellspacing="0" cellpadding="0" class="menuTable">
<tr>
<td class="menu">
<? include "menu.php";?>
</td>
</tr>
</table>


</div> <!--end menuDiv-->
<!--end menu and search-->


<!--start top content-->
<div id="wrapperTopContentDiv">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top" width="50">&nbsp; </td>
<td valign="top">
<?
$result=question_view_id($question);
$row=mysql_fetch_array($result);
$date=split("-",$row["question_date"]);
?>
<div id="readNewsRightContentDiv">
<p class="pReadNewsRightContentHeader"><?=$row["question_topic"]?></p>
<p class="pReadNewsRightContentDate">วันที่ <?=$date[2]?>/<?=$date[1]?>/<?=$date[0]?> ..................................</p>
<br>
<div id="bodyContent">
<?=$row["question_desc"]?>
</div>
</div>
<br><br>
<hr style="color:#003300; width:70%" />
<?
/// ---------------- เพิ่มมา --------------------->
$perpage=2;
if(!isset($page)){
$page=1;
}
list($result2,$total)=answer_view($question,$page,$perpage);
// ---------------- --------------------->
while($row2=mysql_fetch_array($result2)){
$date=split("-",$row2["answer_date"]);
?>
<div id="readNewsRightContentDiv">
<?=$row2["answer_desc"]?>
<br/><br>
<p class="pReadNewsRightContentDate" align="right">แสดงความคิดเห็น โดย <?=$row2["answer_name"]?></p>
<p class="pReadNewsRightContentDate" align="right">วันที่ <?=$date[2]?>/<?=$date[1]?>/<?=$date[0]?></p>
</div>
<hr style="color:#003300; width:70%" />

<?
}
?>
<!---------------- เพิ่มมา --------------------->
<div align="right" style="margin-right:20px">
<?
if($total>1){
showPageAnswer($total,$page,$question);
}
?>

</div>
<? //if(isset($_SESSION["user"])){?>
<div id="readNewsRightContentDiv">
<p class="pReadNewsRightContentHeader">แสดงความคิดเห็น</p>
<p class="pReadNewsRightContentDate"> ..................................</p>
<form action="" method="post">
<table width="600" border="0" cellpadding="5" cellspacing="6">
<tr>
<td width="118" valign="top">&nbsp;</td>
<td width="466"><textarea name="desc" cols="50" rows="10"></textarea>
<input name="question" type="hidden" value="<?=$row["question_id"]?>" /></td>
</tr>
<tr>
<td>ชื่อ</td>
<td>
<input type="text" name="name" id="name" />
</td>
</tr>
<tr>
<td>อีเมล์</td>
<td><input type="text" name="email" id="email" /></td>
</tr>
<tr>
<td>&nbsp;</td>
<td><input type="submit" name="Submit" value="แสดงความคิดเห็น" />
<input type="reset" name="Submit2" value="ยกเลิก" /></td>
</tr>
</table>
</form>
<p class="pReadNewsRightContentDate">&nbsp;</p>
<br>
<div id="bodyContent"> </div>
</div>
<br><br>
<? //}?> </td>
</tr>
</table>


</div> <!--end wrapperTopContentDiv-->
<!-- end top content-->


<div id="footerDiv">
Copyright © 2001-2010 ivf All rights reserved. Telephone: 0108414736771, Fax: 025255544
</div>




</div><!-- end wrapperDiv-->
</body>
</html>

error

[font=Verdana]อยากให้โค้ดแบ่งหน้ามาอยู่ข้างบนมุมขวาของหน้าด้วย ต้องทำไงคะ และก็ error ด้วย แก้ตรงไหนคะ[/font]



Tag : PHP







Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2010-08-26 16:07:04 By : mostgirls View : 1094 Reply : 2
 

 

No. 1



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



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


function_question.php

Code (PHP)
<?
function question_insert($name,$desc,$name1,$email,$webboard){
$date=date("Y-m-d");
$sql="insert into question(question_topic,question_desc,question_date,question_name,question_email,webboard_id)";
$sql .="values('$name','$desc','$date','$name1','$email','$webboard')";
$result=mysql_query($sql);
return $result;

}

function question_view($webboard,$page,$perpage){
$sql="select *from question where webboard_id='$webboard' order by question_id desc";
$result=mysql_query($sql);
$nr=mysql_num_rows($result); 
$totalpage =  ceil($nr/$perpage);
				$sql_limit = ($page - 1) * $perpage ;
				$sql_limit = " LIMIT " . $sql_limit . ", " . $perpage . " "; 
				$sql .= $sql_limit ;
				$result1=mysql_query($sql);
return array($result1,$totalpage);

}

function question_view_id($id){
$sql="select *from question where question_id='$id' ";
$result=mysql_query($sql);
return $result;
}

function question_view_index($webboard){
//$sql="select *from question where webboard_id='$webboard' order by question_id desc Limit 0,5";
$sql="SELECT question.question_id as question_id,question_topic,max(answer_id) as answer_max  FROM question
LEFT JOIN answer ON question.question_id = answer.question_id where webboard_id='$webboard' Group BY question.question_id Order by answer_max desc Limit 0,10";
$result=mysql_query($sql);
return $result;

/*
SELECT question.question_id as question_id,question_topic,max(answer_id) as answer_max FROM question LEFT JOIN answer ON question.question_id = answer.question_id where webboard_id='1'  group by question.question_id order by answer_max desc
*/

}

function answer_insert($desc,$question,$name,$email){
$date=date("Y-m-d");
$sql="insert into answer(answer_desc,answer_date,answer_name,answer_email,question_id)";
$sql .="values('$desc','$date','$name','$email','$question')";
$result=mysql_query($sql);
return $result;
}
function answer_view($question,$page,$perpage){
$sql="select *from answer question_id='$question' order by answer_id ASC";
$result=mysql_query($sql);
$nr=mysql_num_rows($result); 
$totalpage =  ceil($nr/$perpage);
				$sql_limit = ($page - 1) * $perpage ;
				$sql_limit = " LIMIT " . $sql_limit . ", " . $perpage . " "; 
				$sql .= $sql_limit ;
				$result1=mysql_query($sql);
return array($result1,$totalpage);
}
?>







แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2010-08-26 16:09:02 By : mostgirls
 


 

No. 2



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



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


ทำยังไม่ได้เลย
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2010-08-27 15:09:27 By : mostgirls
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : โค้ดแบ่งหน้าค่ะ error และก็อยากให้ บรรทัดที่แบ่งมาอยู่ข้างบน มุมขวา ด้วย ต้องทำไงคะ
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ 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 อัตราราคา คลิกที่นี่