search
Homephp教程php手册基于TP的灵感,用PDO类封装了一个链式Model底层

完整的链式封装已经完成,并且用在了我最近开发的小型框架——JunPHP中作为Model模型底层。这样就将其中最简单的一部分查询操作先开源给大家学习下
/*
链式操作一般有:
where 查询条件
field 指定查询结果集中的返回字段
order 排序
limit 限制查询结果

结尾方法:
select 执行查询返回二维数组
find 执行查询,只能返回一条数据,返回一维数组
*/

$db = new Model();
$res = $db->M('article')->order('id desc')->select();//返回查询结果的二维数组
$res = $db->M('article')->order('id asc')where('id=3')->find();//返回查询结果的一位数组,只能返回一条记录

下载地址:http://www.im158.com/zhishi-Showz-pid-40-id-48.html

AD:真正免费,域名+虚机+企业邮箱=0元

Statement
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

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.

Undress AI Tool

Undress AI Tool

Undress images for free

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 Article

Hot Tools

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools