国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

Home Backend Development PHP Tutorial A class that connects odbc to mssql paging_PHP tutorial

A class that connects odbc to mssql paging_PHP tutorial

Jul 21, 2016 pm 04:08 PM
.net class mssql odbc pages var Pagination database data sheet cursor of kind connect


class Pages{
var $cn; //Connect the database cursor
var $d; //Connect the data table Cursor
var $result; //Result
var $dsn; > var $total; //Total number of records
var $pages; //Total number of pages
var $onepage; //Number of entries per page
var $page; //Previous page
var $net; //Next page
var $i; ??> $this->cn=@odbc_connect($dsn,$user,$pass);
if(!$this->cn){
$error="Error connecting to database";
??????????????????????????????????????????????????????????????????????????????????????????????????@odbc_do($this->cn,$sql);
If(!$this->d){
$error="A small error occurred during query...";
????????? $this->getMess($error); $this ->sql=$sql;
??????????????? $dT=$this->getDo($this->sql);????????????????????????????????????????????????????????????'total');//Why can't $this->d be used here?
return $this->total;
}

function getList($sql,$onepage,$page){
$this->s=$sql;
$this->onepage=$onepage;
$this->page=$page;
$this->dList=$this->getDo($this->s); // Cursor for joining table
$this->pages=ceil($this->total/$this->onepage);
if($this->pages==0) ??
$ this->pages++; //Cannot get page 0
if(!isset($this->page))
$this->page=1;
$this-> fre = $this->page-1; //The number of pages to be displayed
->page-1)*$this->onepage;
//if($this->nums!=0){
this->i<$pg->getNums();odbc_fetch_row($this->dd),$this->i++);//Same as above
???????????????????????????????????????????????????????????????>i=0;//Why can’t this part be encapsulated?
????????return $this->dList;
????}

????function getFanye(){
????????$str="";
????????if($this->page!=1)
????????????$str.=" 首頁(yè) 前頁(yè) ";
????????????else
????????????????$str.="首頁(yè) 前頁(yè)";
????????if($this->page<$this->pages)
????????????$str.=" 后頁(yè) ";
????????????else
????????????????$str.=" 后頁(yè) ";
????????if($this->page!=$this->pages)
????????????$str.=" 尾頁(yè) ";
????????????else
????????????????$str.=" 尾頁(yè) ";

????????$str.="共".$this->pages."頁(yè)";
????????$str.="您正瀏覽第".$this->page."頁(yè)";
????????return $str;
????}

????function getNums(){
????????return $this->nums;
????}

????function getOnepage(){//每頁(yè)實(shí)際條數(shù)
????????return $this->onepage;
????}

????function getI(){
????????return $this->i;
????}

????function getPage(){
????????return $this->page;
????}

????function getMess($error){//定制消息
????????echo"

$error
";
????????exit;
????}
}

$pg=new Pages();
$pg->getConnect("lei","sa","star");
$pg->getTotal("select count(*) as total from xs");????????????//連學(xué)生表求總數(shù)
$pg->getList("select xs_name from xs order by xs_id",8,$page);
if($pg->getNums()!=0){
????for($i=0;$i<$pg->getNums();odbc_fetch_row($pg->dList),$i++);//同上
}
$i=0;
while(odbc_fetch_row($pg->dList)){
????$name=odbc_result($pg->dList,"xs_name");
????echo $name."
";
????if($i==$pg->getOnepage()){//跳出循環(huán)
????????break;
????}
????$i++;
}
echo$pg->getFanye();
?>

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/314636.htmlTechArticle!--二泉.net -- ? class Pages{ var $cn;//連接數(shù)據(jù)庫(kù)游標(biāo) var $d;//連接數(shù)據(jù)表的游標(biāo) var $result;//結(jié)果 var $dsn;//dsn源 var $user;//用戶(hù)名 var $pass;//密碼 var...
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undress AI Tool

Undress AI Tool

Undress images for free

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

PHP Tutorial
1502
276
.NET Core Quick Start Tutorial 1. The beginning: Talking about .NET Core .NET Core Quick Start Tutorial 1. The beginning: Talking about .NET Core May 07, 2025 pm 04:54 PM

1. The Origin of .NETCore When talking about .NETCore, we must not mention its predecessor .NET. Java was in the limelight at that time, and Microsoft also favored Java. The Java virtual machine on the Windows platform was developed by Microsoft based on JVM standards. It is said to be the best performance Java virtual machine at that time. However, Microsoft has its own little abacus, trying to bundle Java with the Windows platform and add some Windows-specific features. Sun's dissatisfaction with this led to a breakdown of the relationship between the two parties, and Microsoft then launched .NET. .NET has borrowed many features of Java since its inception and gradually surpassed Java in language features and form development. Java in version 1.6

Oracle's Role in the Business World Oracle's Role in the Business World Apr 23, 2025 am 12:01 AM

Oracle is not only a database company, but also a leader in cloud computing and ERP systems. 1. Oracle provides comprehensive solutions from database to cloud services and ERP systems. 2. OracleCloud challenges AWS and Azure, providing IaaS, PaaS and SaaS services. 3. Oracle's ERP systems such as E-BusinessSuite and FusionApplications help enterprises optimize operations.

C# .NET: Building Applications with the .NET Ecosystem C# .NET: Building Applications with the .NET Ecosystem Apr 27, 2025 am 12:12 AM

How to build applications using .NET? Building applications using .NET can be achieved through the following steps: 1) Understand the basics of .NET, including C# language and cross-platform development support; 2) Learn core concepts such as components and working principles of the .NET ecosystem; 3) Master basic and advanced usage, from simple console applications to complex WebAPIs and database operations; 4) Be familiar with common errors and debugging techniques, such as configuration and database connection issues; 5) Application performance optimization and best practices, such as asynchronous programming and caching.

MySQL: Structured Data and Relational Databases MySQL: Structured Data and Relational Databases Apr 18, 2025 am 12:22 AM

MySQL efficiently manages structured data through table structure and SQL query, and implements inter-table relationships through foreign keys. 1. Define the data format and type when creating a table. 2. Use foreign keys to establish relationships between tables. 3. Improve performance through indexing and query optimization. 4. Regularly backup and monitor databases to ensure data security and performance optimization.

Deploying C# .NET Applications to Azure/AWS: A Step-by-Step Guide Deploying C# .NET Applications to Azure/AWS: A Step-by-Step Guide Apr 23, 2025 am 12:06 AM

How to deploy a C# .NET app to Azure or AWS? The answer is to use AzureAppService and AWSElasticBeanstalk. 1. On Azure, automate deployment using AzureAppService and AzurePipelines. 2. On AWS, use Amazon ElasticBeanstalk and AWSLambda to implement deployment and serverless compute.

Redis: Understanding Its Architecture and Purpose Redis: Understanding Its Architecture and Purpose Apr 26, 2025 am 12:11 AM

Redis is a memory data structure storage system, mainly used as a database, cache and message broker. Its core features include single-threaded model, I/O multiplexing, persistence mechanism, replication and clustering functions. Redis is commonly used in practical applications for caching, session storage, and message queues. It can significantly improve its performance by selecting the right data structure, using pipelines and transactions, and monitoring and tuning.

Redis: A Comparison to Traditional Database Servers Redis: A Comparison to Traditional Database Servers May 07, 2025 am 12:09 AM

Redis is superior to traditional databases in high concurrency and low latency scenarios, but is not suitable for complex queries and transaction processing. 1.Redis uses memory storage, fast read and write speed, suitable for high concurrency and low latency requirements. 2. Traditional databases are based on disk, support complex queries and transaction processing, and have strong data consistency and persistence. 3. Redis is suitable as a supplement or substitute for traditional databases, but it needs to be selected according to specific business needs.

C# as a Versatile .NET Language: Applications and Examples C# as a Versatile .NET Language: Applications and Examples Apr 26, 2025 am 12:26 AM

C# is widely used in enterprise-level applications, game development, mobile applications and web development. 1) In enterprise-level applications, C# is often used for ASP.NETCore to develop WebAPI. 2) In game development, C# is combined with the Unity engine to realize role control and other functions. 3) C# supports polymorphism and asynchronous programming to improve code flexibility and application performance.

See all articles