Code Monkey home page Code Monkey logo

php_pdo's Introduction

常规
1. 与php pdo 一样的初始化。例如$db = new db('mysql:host=localhost;dbname=crm;charset=utf8', 'root', 'root');
2. 增加getOne, getRow, getCol, getAll 四个直接通过sql获取数据的方法
3. 修改query()函数, 支持 $db->query('select :name from table', array('name'=>'id')) 这种写法。
4. $db['table']->insert(array('kk'=>'fff'));  //将数据插入到table表,并返回插入id
魔法
1. count($db) 获取当前数据库中有多少表
2. $db['table']; //获取tableb表对象
3. $db['table'][] = array('kk'=>'fff'); //将array()数据插入到table表
4. $db['table'][1] = array('kk'=>'fff'); //更新主键为1的数据
5. unset($db['table][1]); //删除主键为1的数据
6. $db['table'][array('id'=>1)]; //返回id等于1的数据
9. $db['table'][array('id:>'=>1)]; //返回id大于1的数据, 支持>, <, >=, <=, =
10. $db['table'][array('id'=>array(1, 3, 5))]; //返回id等于1, 3, 5的数据
11. $db['table']->order('id DESC')->limit(0, 1)->query(array('id:>'=>1));
12. count($db['table']->where(array('id:>'=>1))); //id 大于1的数据数量
13. $db['table'][1] = array('kk:+'=>2); //更新主键为1的数据z字段kk自己增加2

php_pdo's People

Contributors

wjzhangq avatar

Stargazers

Julio Cesar Zuppa avatar Alexander Tsirel avatar Stefano avatar  avatar

Watchers

 avatar James Cloos avatar  avatar

Forkers

brozzis noma4i

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.