|
|
|
แก้ error sql ตามกระทู้เก่าๆ แล้วไม่ได้อยู่ดีคะ ช่วยๆๆ หน่อยนะคะ |
|
|
|
|
|
|
|
Code
Fatal error: Call to undefined function mssql_num_rows() in C:\AppServ\www\homemall\hmpanel\careers\showapply.php on line 40
https://www.thaicreate.com/php/forum/032458.html
<?
include("config.php");
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
.simply{
font:14px Verdana;
margin: 45px;
width: 480px;
border-collapse: collapse;
text-align: left;
}
.simply th{
font:normal 16px Verdana;
color: #222;
background:#cbeffd;
padding: 10px 8px;
border-bottom: 2px solid #ccc;
}
.simply td{
border-bottom: 1px solid #ccc;
color: #666;
background: #fff;
padding: 5px;
}
.simply tbody tr:hover td{
color: #222;
background: #eee;
}
</style>
</head>
<body>
<?php
$strSQL = "SELECT * FROM application ORDER BY ApplyID DESC";
$objQuery = mssql_query($strSQL) or die ("Error Query [".$strSQL."]");
$Num_Rows = mssql_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;
}
$Page_End = $Per_Page * $Page;
IF ($Page_End > $Num_Rows)
{
$Page_End = $Num_Rows;
}
?>
<table class="simply" summary="PremierShip Top5">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">Name</th>
<th scope="col">ตำแหน่งที่1</th>
<th scope="col">ตำแหน่งที่2</th>
<th scope="col">เงินเดือนที่ต้องการ</th>
<th scope="col">aaa</th>
</tr>
</thead>
<?
for($i=$Page_Start;$i<$Page_End;$i++)
{
?>
<tbody>
<tr>
<td><?=mssql_result($objQuery,$i,"ApplyID");?></td>
<td><?=mssql_result($objQuery,$i,"Name");?></td>
<td><?=mssql_result($objQuery,$i,"Position1ID");?></td>
<td><?=mssql_result($objQuery,$i,"Position2ID");?></td>
<td><?=mssql_result($objQuery,$i,"NeedSalary");?></td>
<td></td>
</tr>
</tbody>
<?
}
?>
</table>
<br>
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> ";
}
mssql_close($objConnect);
?>
</body>
</html>
Tag : PHP
|
ประวัติการแก้ไข 2012-01-11 22:46:49
|
|
|
|
|
Date :
2012-01-11 22:45:46 |
By :
Poster |
View :
1015 |
Reply :
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ได้ละคะ ขอบคุนค่า
หนูเปลี่ยจาก mssql เป็น mysql
|
|
|
|
|
Date :
2012-01-12 00:34:04 |
By :
Poster |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 04
|