有没有好用的开源的php mysql class,类似medoo的那种
但是medoo没有 orderby limit 等功能
CI框架中的db类比较好用,但是我想脱离ci去用他的db类,现在还做不到
有没有知道其他的好用的mysql class,最好是开源的成熟的
回复讨论(解决方案)
求推荐,谢谢各位
直接把ci的扒出来用。我以前扒过
直接把ci的扒出来用。我以前扒过
水平有限,扒了一次没成功,不过真心觉得ci的数据库类写的不错
直接把ci的扒出来用。我以前扒过
水平有限,扒了一次没成功,不过真心觉得ci的数据库类写的不错
实在不行 这周末我就重新扒一次共享一下
medoo 不就很好的吗?
medoo 是有 order by 的( http://medoo.in/api/where)
$database->select("account", "user_id", [ "GROUP" => "type", // "ORDER" => "age DESC" "ORDER" => "age", // Must have to use it with ORDER together "HAVING" => [ "user_id[>]" => 500 ], // LIMIT => 20 "LIMIT" => [20, 100]]);// SELECT user_id FROM account// GROUP BY type// ORDER BY age// HAVING user_id > 500// LIMIT 20,100
medoo 不就很好的吗?
medoo 是有 order by 的( http://medoo.in/api/where)
$database->select("account", "user_id", [ "GROUP" => "type", // "ORDER" => "age DESC" "ORDER" => "age", // Must have to use it with ORDER together "HAVING" => [ "user_id[>]" => 500 ], // LIMIT => 20 "LIMIT" => [20, 100]]);// SELECT user_id FROM account// GROUP BY type// ORDER BY age// HAVING user_id > 500// LIMIT 20,100
晕,怪我自己没有注意看,确实是有这个功能,谢谢了!
CI 的数据库类也不需要扒吧?
不就在 system/database 中么
CI 的数据库类也不需要扒吧?
不就在 system/database 中么
貌似牵扯一些其他文件的方法调用
没用过,不是很清楚,应该只和配置文件有关吧
只不过调用是透明的
这个很不错呀
<?php include 'sql_build_query.php';include 'pdo_query.php';$db = new pdo_db; $sql = $db->pdo_query('show databases '); var_dump( $sql, $db->dbVersion() ); exit; $sql = $db->select( 'i.kd k, io.id dk, iil.ii ds' )->from( 'test t' ) ->leftjoin( 'post p', 't.id = ?', array( 2 ) ) ->order( 'name DESC, id ASC' ) ->where( array( 'xin = ? AND do > ?' => array( 1,3 ))) ->having( array('xin' => 'dkls' )) ->group( 'id' ) ->limit( 3,4 ) ->queryAll();exit;//var_dump( $sql ); $sql = $db->from( 'test') ->insert( array( 'kd' => '233', 'dkwe' => 323 )); $sql = $db->from( 'test' ) ->where( array( '( dk = ? and kd > ?) or ( dk = ? and ddd = ?)' => array( 2,3,5,4 ))) ->limit( 2 , 4 ) ->update( array( 'dkddl' => 'd', 'kdls' => 'dkdl' )); $sql = $db->from( 'test,test' ) ->select( 'test,test' ) ->where( array( 'id' => array( 3,3,4,2,3) )) ->limit( '3', 3) ->delete();
http://php.xlxz.org/2013/11/370/

APHPDependencyInjectionContainerisatoolthatmanagesclassdependencies,enhancingcodemodularity,testability,andmaintainability.Itactsasacentralhubforcreatingandinjectingdependencies,thusreducingtightcouplingandeasingunittesting.

Select DependencyInjection (DI) for large applications, ServiceLocator is suitable for small projects or prototypes. 1) DI improves the testability and modularity of the code through constructor injection. 2) ServiceLocator obtains services through center registration, which is convenient but may lead to an increase in code coupling.

PHPapplicationscanbeoptimizedforspeedandefficiencyby:1)enablingopcacheinphp.ini,2)usingpreparedstatementswithPDOfordatabasequeries,3)replacingloopswitharray_filterandarray_mapfordataprocessing,4)configuringNginxasareverseproxy,5)implementingcachingwi

PHPemailvalidationinvolvesthreesteps:1)Formatvalidationusingregularexpressionstochecktheemailformat;2)DNSvalidationtoensurethedomainhasavalidMXrecord;3)SMTPvalidation,themostthoroughmethod,whichchecksifthemailboxexistsbyconnectingtotheSMTPserver.Impl

TomakePHPapplicationsfaster,followthesesteps:1)UseOpcodeCachinglikeOPcachetostoreprecompiledscriptbytecode.2)MinimizeDatabaseQueriesbyusingquerycachingandefficientindexing.3)LeveragePHP7 Featuresforbettercodeefficiency.4)ImplementCachingStrategiessuc

ToimprovePHPapplicationspeed,followthesesteps:1)EnableopcodecachingwithAPCutoreducescriptexecutiontime.2)ImplementdatabasequerycachingusingPDOtominimizedatabasehits.3)UseHTTP/2tomultiplexrequestsandreduceconnectionoverhead.4)Limitsessionusagebyclosin

Dependency injection (DI) significantly improves the testability of PHP code by explicitly transitive dependencies. 1) DI decoupling classes and specific implementations make testing and maintenance more flexible. 2) Among the three types, the constructor injects explicit expression dependencies to keep the state consistent. 3) Use DI containers to manage complex dependencies to improve code quality and development efficiency.

DatabasequeryoptimizationinPHPinvolvesseveralstrategiestoenhanceperformance.1)Selectonlynecessarycolumnstoreducedatatransfer.2)Useindexingtospeedupdataretrieval.3)Implementquerycachingtostoreresultsoffrequentqueries.4)Utilizepreparedstatementsforeffi


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

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

Hot Article

Hot Tools

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.

SublimeText3 English version
Recommended: Win version, supports code prompts!

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

Dreamweaver CS6
Visual web development tools

Atom editor mac version download
The most popular open source editor
