The lightweight PHP database framework to accelerate development

Overview

Total Downloads Latest Stable Version License Backers on Open Collective Sponsors on Open Collective

The lightweight PHP database framework to accelerate development

Features

  • Lightweight - Less than 100 KB, portable with only one file

  • Easy - Extremely easy to learn and use, friendly construction

  • Powerful - Supports various common and complex SQL queries, data mapping, and prevent SQL injection

  • Compatible - Supports all SQL databases, including MySQL, MSSQL, SQLite, MariaDB, PostgreSQL, Sybase, Oracle and more

  • Friendly - Works well with every PHP frameworks, like Laravel, Codeigniter, Yii, Slim, and framework which supports singleton extension or composer

  • Free - Under MIT license, you can use it anywhere whatever you want

Requirement

PHP 5.4+ and PDO extension installed, recommend PHP 7.0+

Get Started

Install via composer

Add Medoo to composer.json configuration file.

$ composer require catfan/medoo

And update the composer

$ composer update
// If you installed via composer, just use this code to require autoloader on the top of your projects.
require 'vendor/autoload.php';

// Using Medoo namespace
use Medoo\Medoo;

// Initialize
$database = new Medoo([
    'database_type' => 'mysql',
    'database_name' => 'name',
    'server' => 'localhost',
    'username' => 'your_username',
    'password' => 'your_password'
]);

// Enjoy
$database->insert('account', [
    'user_name' => 'foo',
    'email' => '[email protected]'
]);

$data = $database->select('account', [
    'user_name',
    'email'
], [
    'user_id' => 50
]);

echo json_encode($data);

// [
//     {
//         "user_name" : "foo",
//         "email" : "[email protected]",
//     }
// ]

Contribution Guides

For most of time, Medoo is using develop branch for adding feature and fixing bug, and the branch will be merged into master branch while releasing a public version. For contribution, submit your code to the develop branch, and start a pull request into it.

On develop branch, each commits are started with [fix], [feature] or [update] tag to indicate the change.

Keep it simple and keep it clear.

License

Medoo is under the MIT license.

Links

Comments
  • Join condition based on one of the tables

    Join condition based on one of the tables

    How to use join to select conditional data from one table.

    For example, look at this query:

    select question.id, question.text, vote.vote as myvote from question left join vote on vote.questionId=question.id and vote.userId=2 where question.id=6;

    How to achieve similar results with Medoo?

    opened by sourabhbajaj 17
  • Version 1.0.2

    Version 1.0.2

    Dear all, I have downloaded the new version but I see this error: Fatal error: Call to a member function quote() on a non-object in C:\sutrsy\conmed.php on line 156 I don't have changed anything on my site and reloaded the old version the script run without problem Some help?

    opened by cormiodo 14
  • Why Mysql table name use Double quotes?

    Why Mysql table name use Double quotes?

    hi~

    // Make MySQL using standard quoted identifier
    $commands[] = 'SET SQL_MODE=ANSI_QUOTES';
    

    No effect, in version 1.0

    so , Generated SQL statement:

    SELECT * FROM "yc_category" LIMIT 1
    

    error in mysql version 5.6.13

    How to solve?

    Thank you!

    opened by lxepoo 14
  • insert always return 0 and there is no error message

    insert always return 0 and there is no error message

    I just started to use medoo to make my database learning live easier. My table has 5 fields:Primary ID,varchar Unique userid,varchar date,int status,varchar mark. I am able to do 'SELECT', so there is problem with the connection, but when I do insert:

    $db = new medoo([...]);
    
      function insertRecord($database,$userid,$date,$status,$mark=NULL){
        return $database->insert('atdc',[
          "userid" => $userid,
          "date" => $date,
          "status" => $status,
          "mark" => $mark
        ]);
      }
    
      $r = insertRecord($db,'das','2016-06-12',0,'dad');
    
      var_dump($r);
      var_dump($db->error());
    

    $r is always 0(if data inserted, it should be the last id), no matter what data I use. But $db->error() returns 00000, which I believe means no error. The data is not inserted, also no error message in PHP error log. I can't figure out what is possibly wrong, please help.

    opened by newjie 13
  • Add distinct() method

    Add distinct() method

    User can do $db->distinct()->select(...) to do a distinct selection (add DISTINCT to the query).

    Used code from the post by @darre4nbrown in issue #113.

    This simple to use and a crucial feature for interacting with a database.

    opened by sargunv 13
  • add additional conditions to join, ref. #167

    add additional conditions to join, ref. #167

    This change makes it possible to add additional conditions to a join as discussed in #167;

    If the addition is a value with the joined table use the modifier [$]:

    'right_table_column[$]' => value
    

    If it is a table relation use it as any other join condition

    'left_table_column' => 'right_table_column'
    
    opened by alpipego 13
  • [MySQL] - don't understand

    [MySQL] - don't understand " for table, only `

    As i wrote in title, for Mysql all my requests are KO.

    for BAD example generated :

    SELECT * FROM "table"
    

    for GOOD example :

    SELECT * FROM `table`
    

    if type is mysql, object delimiter (database, table and column) is `

    opened by ghost 12
  • [Feature Request] Allow DISTINCT in a select statement

    [Feature Request] Allow DISTINCT in a select statement

    For example, I would like to run a query like this.

    SELECT DISTINCT(month), year FROM posts

    I haven't found anything in the documentation that addresses this. Perhaps the syntax could be like this:

    $medoo->select("posts", array("month", "year"), array("DISTINCT" => "month")); or: $medoo->select("posts", array("DISTINCT month", "year")); or: $medoo->select("posts", array("DISTINCT(month)", "year"));

    I don't think this would be too difficult to implement. I would be willing to help out, but I need to study the codebase more carefully first.

    opened by Brobin 12
  • Medoo quoting table cause query to fail with MSSQL server 14.0.3029.16

    Medoo quoting table cause query to fail with MSSQL server 14.0.3029.16

    Describe the bug Using medoo library to connect to a MySQL database and MSSQL database. It works perfectly with MySQL database but with MSSQL simple select query are failing. This is observed when MSSQL database has collection, schema and table.

    In this case, medoo using method tableQuote adds " before and after table name, making select query to fail / return empty results. Details are shared below.

    Information

    • Version of Medoo: 1.6
    • Type of Database (MySQL, MSSQL, SQLite...): MSSQL
    • System (Liunx\Windows\Mac): Linux

    Detail Code

    Name of database is medoo_test

    It has a collection named game and that collection has table named users.

    So in MSSQL I can execute this query:

    USE medoo_test
    GO
    SELECT TOP 10 user_id FROM [game].[users]
    GO
    

    OR

    USE medoo_test
    GO
    SELECT TOP 10 user_id FROM game.users
    GO
    

    But SELECT TOP 10 user_id FROM "game.users" will raise error in MSSQL.

    In Medoo code, after connecting to database successfully, following line of code is executed:

    $users = $db_connection->select('game.users', '*');

    But found $users array was empty. So used debug() method to get generated query like:

    $query = $db_connection->debug()->select('game.users', '*'); 
    echo $query . "\n";
    

    and output show:

    SELECT * FROM "game.users"
    

    I found that tableQuote method in Medoo.php file and changed it to

    protected function tableQuote($table)
    {
            return $this->prefix . $table;
    // 	return '"' . $this->prefix . $table . '"';
    }
    

    and then executed same code and it produced query without " character surrounding table name, and I also got results as expected.

    Expected output I should get results from MSSQL database table users into my php array.

    opened by klodha 11
  • create PDO connection once by save in

    create PDO connection once by save in "self" class "not object"

    If connection args sended to "new medoo(array(...))" PDO object can be saved in self::$pdo If no args send to "new medoo()" PDO object can be returned from self::$pdo 1 connection - many queries

    same in log: can be saved is self::$queries not $this::$queries

    opened by almakano 11
  • STOP minification

    STOP minification

    Theres really no point to doing it, and the size of the project really isn't a big deal at all. As none of this code gets transferred to the client, theres no bandwidth issue.

    opened by aequasi 11
  • Medoo internal regex alters my insertion values

    Medoo internal regex alters my insertion values

    Information

    • Version of Medoo: 2.1.7
    • Version of PHP: 8.2
    • Type of Database (MySQL, MSSQL, SQLite...): MySQL
    • System (Liunx|Windows|Mac): Linux

    Describe the Problem I was running an INSERT query with a string value like '<[email protected]>', and Medoo replaced my < > with quotes leaving it like "xxxxx@xxxx"."com".

    After investigating, I found line 664 (function buildRaw), this function is applying a preg_replace to the query: '/(([`']).?)?((FROM|TABLE|INTO|UPDATE|JOIN|TABLE IF EXISTS)\s)?<(([\p{L}_][\p{L}\p{N}@$#-_])(.[\p{L}_][\p{L}\p{N}@$#-_])?)>([^,]*?\2)?/u'

    This regex is also modifying string values inside single quotes 'xxxxx', so I asked ChatGPT to fix it 😂 It gave me this:

    '/(([`']).?)?((FROM|TABLE|INTO|UPDATE|JOIN|TABLE IF EXISTS)\s)?(?<!')<(([\p{L}][\p{L}\p{N}@$#-])(.[\p{L}][\p{L}\p{N}@$#-])?)>(?!')([^,]*?\2)?/u'

    And it works! I haven't tested if it causes other problems, but for now so far everything's working fine and the bug is solved.

    Detail Code

    Simply run this query:

    $db->query("INSERT INTO table ( column ) VALUES ( '<[email protected]>' )");
    
    

    Expected output It should save exactly what you write, but instead, If you check the database after insertion, you will see: "C5TBEC76-9DC0-4758-9FA1-21DDO6B91D59@mail"."com"

    ** I know that parameters shouldn't be passed like that, directly in the string, but doesn't change the fact that Medoo shouldn't alter the value in this way, so I assumed it's a bug.

    opened by oscarsalesdev 1
  • PHP 8.2 support

    PHP 8.2 support

    Medoo 2.1.7 | PHP 8.2 | MySQL | Linux

    Deprecations

    PHP Deprecated:  Using ${var} in strings is deprecated, use {$var} instead in /vendor/catfan/medoo/src/Medoo.php on line 870
    PHP Deprecated:  Using ${var} in strings is deprecated, use {$var} instead in/vendor/catfan/medoo/src/Medoo.php on line 1321
    
    opened by jadeops 0
  • [Bug]Cannot use multiple columns with raw()

    [Bug]Cannot use multiple columns with raw()

    Information

    • Version of Medoo: 2.1.7
    • Version of PHP: 7.3
    • Type of Database (MySQL, MSSQL, SQLite...): MySQL
    • System (Liunx|Windows|Mac): Windows 10

    Describe the Problem Column names other than the first disappear.

    Detail Code table test | os | | ---- | | win | | mac | | win | | ios |

    $db->get('test', ['pc'=>Medoo::raw("count(<os>='win' OR <os>='mac' OR NULL)")]);
    

    SQL with the second "os" column disappeared is executed

    SELECT count("os"='win' OR ='mac' OR NULL) AS `pc` FROM `test` LIMIT 1
    

    desired SQL

    SELECT count("os"='win' OR "os"='mac' OR NULL) AS `pc` FROM `test` LIMIT 1
    

    Solution I tried

    I thought there was a problem with the "buildRaw" method

    the value of the variable in buildRaw method
    
    [$raw->value]
    count(<os>='win' OR <os>='mac' OR NULL)
    
    [$matches]
    Array
    (
        [0] => <os>
        [1] => 
        [2] => 
        [3] => 
        [4] => 
        [5] => os
        [6] => os
    )
    Array
    (
        [0] => 'win' OR <os>='
        [1] => 'win' OR 
        [2] => '
        [3] => 
        [4] => 
        [5] => os
        [6] => os
        [7] => 
        [8] => ='
    )
    
    [$query]
    count("os"='win' OR ='mac' OR NULL)
    
    "os" is missing here
    

    This issue was resolved by doing the following.

                function ($matches) {
                    // add && empty($matches[5])
                    if (!empty($matches[2]) && isset($matches[8]) && empty($matches[5])) {
                        return $matches[0];
                    }
    
                    if (!empty($matches[4])) {
                        return $matches[1] . $matches[4] . ' ' . $this->tableQuote($matches[5]);
                    }
    
                    // add . ($matches[8]??'')
                    return $matches[1] . $this->columnQuote($matches[5]) . ($matches[8]??'');
                },
    
    bug 
    opened by webgoto 0
  • In update copy field

    In update copy field

    Information

    • Version of Medoo:
    • Version of PHP:
    • Type of Database (MySQL, MSSQL, SQLite...):
    • System (Liunx|Windows|Mac):

    Describe the Problem A clear and concise description of what the problem is.

    Detail Code The detail code you are using causes the problem.

    // Write your PHP code here
    
    

    Most of the features are like insert(), they support array serialization and type auto-detection. Additionally you can use [+], [-], [*] and [/] for mathematical operation.

    Expected output A clear and concise description of what output you expected. users table Schema id,username,password,c_date,b_date

    I need a SQL like this update users set c_date=b_date; I can't find description on how to do this in the docs.

    I tried both doesn't work "c_date" => "b_date", "c_date[=]" => "b_date",

    opened by louishot 1
  • "Dump and Die" - debugging

    Hello, I just found out that one of the systems where I work uses medoo, searching the documentation I didn't find a method that makes it easy to view variables in the browser.

    Not that this is a problem because we can use var_dump() and print_r().

    Would it be possible to create an easy native method?

    Example: Laravel has a specific short helper function to show variables - ​dd()

    similar to debug(), but instead of displaying the SQL, it retrieves the contents of the query.

    opened by Cristianpl4y 2
Releases(v2.1.7)
  • v2.1.7(Jul 2, 2022)

    • [update] the default commands can be overridden by the connection command option. #1048

    You can now override Medoo predefined commands.

    new Medoo([
    	'command' => [
    		'SET SQL_MODE="ANSI_QUOTES,ONLY_FULL_GROUP_BY"'
    	]
    ]);
    
    • [fix] output unsupported PDO attr on info(). #1049
    Source code(tar.gz)
    Source code(zip)
  • v2.1.6(May 10, 2022)

  • v2.1.5(May 4, 2022)

  • v2.1.4(Dec 13, 2021)

    • Improve operator matching and will throw an error for the invalid operator.
    • Fixed using Raw with join for select().
    • Fixed isJoin doc return type.
    Source code(tar.gz)
    Source code(zip)
  • v2.1.3(Oct 9, 2021)

  • v2.1.2(Jul 27, 2021)

  • v2.1.1(Jul 9, 2021)

  • v2.1.0(Jun 7, 2021)

    Raw for BETWEEN

    $this->database->select("account", "user_name", [
    	"birthday[<>]" => [
    		Medoo::raw("to_date(:from, 'YYYY-MM-DD')", [":from" => '2015/05/15']),
    		Medoo::raw("to_date(:to, 'YYYY-MM-DD')", [":to" => '2025/05/15'])
    	]
    ]);
    
    SELECT "user_name"
    FROM "account"
    WHERE
    ("birthday" BETWEEN to_date('2015/05/15', 'YYYY-MM-DD') AND to_date('2025/05/15', 'YYYY-MM-DD'))
    

    LOBs for Oracle

    Better support for inserting and updating LOBs for the Oracle database.

    $fp = fopen('foo.dat', 'r');
    
    $database->insert("ACCOUNT", [
    	"NAME" => "foo",
    	"DATA" => $fp
    ], "ID");
    
    $database->update("ACCOUNT", [
    	"DATA" => $fp
    ], [
    	"ID" => 1
    ]);
    
    • The regex for matching table name and column name is [\p{L}_][\p{L}\p{N}@$#\-_]+.
    • The performance is slightly improved.
    Source code(tar.gz)
    Source code(zip)
  • v2.0.1(May 12, 2021)

    Quick bug fixed for v2.0.

    • pdo connection undefined warning #962
    • Duplicated table prefix for create() #963
    • Connection warning while using socket #964

    To see what's news about the next gen v2.0: https://medoo.in/api/whatsnew

    Source code(tar.gz)
    Source code(zip)
  • v2.0.0(Apr 28, 2021)

    What is New v2.0

    The milestone version of Medoo. We have updated the whole project with more standard and reliable code, including some new features and significant improvements. We also updated and redesigned the official documentation website.

    Error initialization option

    The new error option to indicate how to handle error information.

    $database = new Medoo([
    	// Can be set as PDO::ERRMODE_SILENT, PDO::ERRMODE_WARNING, PDO::ERRMODE_EXCEPTION
    	// Default is PDO::ERRMODE_SILENT
    	'error' => PDO::ERRMODE_SILENT
    ]);
    

    Simplified connection options

    Those option names are simplified (you can still use the old one of course).

    • database_type -> type
    • database_name -> database
    • server -> host
    // New
    $database = new Medoo([
    	'type' => 'mysql',
    	'host' => 'localhost',
    	'database' => 'name',
    	'username' => 'your_username',
    	'password' => 'your_password',
    ]);
    
    // Old
    $database = new Medoo([
    	'database_type' => 'mysql',
    	'database_name' => 'name',
    	'server' => 'localhost',
    	'username' => 'your_username',
    	'password' => 'your_password',
    ]);
    

    New callback closure for select()

    The high-performance way to output data immediately without loading it into memory.

    $database->select("account", ["name"], function ($data) {
    	echo $data["name"];
    });
    

    New way to getting result from action()

    To get the result from action(), you can provide the reference variable with the use keyword for the closure and then get it back from outside.

    $result = "";
    
    $database->action(function($database) use (&$result) {
    
    	$database->insert("account", [
    		"user_name" => "foo"
    	]);
    
    	$newId = $database->id();
    
    	$result = "The account is created, id is {$newId}.";
    });
    
    echo $result;
    

    New way to get the error information

    The function $database->error() is removed. Just read the $database->error or $database->errorInfo to get the error information last performed.

    $database->insert("account", [
    	"user_name" => "foo"
    ]);
    
    var_dump($database->error);
    var_dump($database->errorInfo);
    

    Last inserted id on Oracle

    If want to the last inserted id on Oracle, provide the primary key as third parameter for insert() and get it from id().

    $database->insert("ACCOUNT", ["NAME" => "foo"], "ID");
    
    var_dump($database->id());
    

    Debug Logging

    To debug the whole or the part of your project without putting debug() to every call, you can use beginDebug() to start debug logging, and then call debugLog() to stop it and get all debug logs as an array.

    // Begin debug logging
    $database->beginDebug();
    
    // All those functions will not be executed but will save it as a debug log.
    $database->select()......
    $database->update().....
    
    // Call debugLog() to stop debug logging and return all debug logs as an array.
    var_dump($database->debugLog());
    
    // Will output:
    // array(2) {
    //  [0]=> string(10) "SELECT ... FROM"
    //  [1]=> string(10) "UPDATE ... SET ... WHERE ..."
    // }
    

    Join with Raw Object and Additional Condition

    $database->select("post", [
    	"[>]comment" => [
    		"author_id" => "user_id",
    		"AND" => [
    			"rate[>]" => 50
    		]
    	],
    	"[>]account" => Medoo::raw("ON <post.author_id> = <account.user_id>")
    ], [
    	"post.content",
    	"comment.content",
    	"account.name"
    ]);
    
    • PSR-2 standard.
    • Test cases included.
    • PHPDoc comments included.
    • Drop support for PHP 5.4, the minimal requirement is PHP 7.3+.
    • Better support for MSSQL and Oracle.
    • Supports using Unicode character as table/column name.
    • The official documentation website https://medoo.in is redesigned.

    Enjoy it! :)

    Source code(tar.gz)
    Source code(zip)
  • v1.7.10(Feb 11, 2020)

  • v1.7.9(Feb 6, 2020)

  • v1.7.8(Dec 19, 2019)

  • v1.7.7(Dec 9, 2019)

  • v1.7.6(Oct 26, 2019)

  • v1.7.5(Oct 12, 2019)

  • v1.7.4(Oct 12, 2019)

  • v1.7.3(Aug 14, 2019)

  • v1.7.2(Jul 13, 2019)

  • v1.7.1(Jul 13, 2019)

  • v1.7.0(Jul 12, 2019)

    New Create() And Drop() API

    Medoo provided two API for creating table and dropping table for better table management on the project.

    $database->create("account", [
    	"id" => [
    		"INT",
    		"NOT NULL",
    		"AUTO_INCREMENT",
    		"PRIMARY KEY"
    	],
    	"first_name" => [
    		"VARCHAR(30)",
    		"NOT NULL"
    	]
    ]);
     
    $database->drop("account");
    

    Index Mapping For Select Output

    It's now able to set column name as the index key for the result.

    $data = $database->select("post", [
    	"user_id" => [
    		"nickname",
    		"location",
    		"email"
    	]
    ]);
     
    // Output data
    [
    	10: {
    		nickname: "foo",
    		location: "New York",
    		email: "[email protected]"
    	},
     
    	12: {
    		nickname: "bar",
    		location: "New York",
    		email: "[email protected]"	
    	}
    ]
    

    Improvements

    • Throw error if used table.* for all columns while joining table
    • Improve code quality

    Bug Fixed

    • Incorrect implode usage
    Source code(tar.gz)
    Source code(zip)
  • v1.6.1(Dec 8, 2018)

  • v1.6(Oct 8, 2018)

    Improved initialization

    Medoo 1.6 is now supported more connection options, and allowed passing PDO object for initialization. Check out more detail from https://medoo.in/api/new

    $database = new Medoo([
    	// required
    	'database_type' => 'mysql',
    	'database_name' => 'name',
    	'server' => 'localhost',
    	'username' => 'your_username',
    	'password' => 'your_password',
    
    	// [optional]
    	'collation' => 'utf8mb4_general_ci',
    
    	// [optional] The application name for MSSQL
    	'appname' => 'test',
    
    	// [optional] MSSQL connection options
    	'application_intent' => 'ReadOnly',
    	'attach_db_file_name' => './database.sql',
    	....
    ]);
    
    $pdo = new PDO('mysql:dbname=test;host=127.0.0.1', 'user', 'password');
    
    $database = new Medoo([
    	// Initialized and connected PDO object
    	'pdo' => $pdo,
    
    	// [optional] Medoo will have different handle method according to different database type
    	'database_type' => 'mysql'
    ]);
    
    try {
    	$database = new Medoo([
    		'database_type' => 'mysql',
    		'database_name' => 'name',
    		'server' => 'localhost',
    		'username' => 'your_username',
    		'password' => 'your_password',
    	]);
    }
    catch (Exception $e) {
    	echo $e->getMessage();
    }
    
    // Will output: Incorrect connection options
    

    New rand() API

    Medoo provided a new way for getting randomized data. It's also compatible with other database.

    $data = $database->rand("account", [
    	"user_name",
    	"email"
    ], [
    	"user_id[>]" => 100
    ]);
    

    Output DSN String for info()

    info() will output the DSN string now. You can check out this for debug database connection.

    print_r($database->info());
    
    /*
    Array
    (
    	[server] => Uptime: 5000  Threads: 1  Questions: 15  Slow queries: 0  Opens: 67  Flush tables: 1
    		Open tables: 60  Queries per second avg: 0.002
    	[client] => mysqlnd 5.0.10 - 20111026 - $Id: a707c415db32080b3752b232487a435ee0372157 $
    	[driver] => mysql
    	[version] => 5.6.10
    	[connection] => localhost via TCP/IP
    	[dsn] => mysql:dbname=test;host=127.0.0.1
    )
    */'
    

    Improvements

    • Call aggregate methods without magic call
    • get() returns NULL instead of False if find nothing
    • Handle MariaDB as same as MySQL
    • Code simplified and improved performance

    Bug Fixed

    • Match keyword is only supported for MySQL
    • Execute special command for customized DSN connection
    Source code(tar.gz)
    Source code(zip)
  • v1.5.7(Jun 14, 2018)

  • v1.5.6(Mar 26, 2018)

  • v1.5.5(Mar 7, 2018)

  • v1.5.4(Jan 8, 2018)

  • v1.5.3(Dec 25, 2017)

  • v1.5.2(Dec 1, 2017)

  • v1.5.1(Nov 24, 2017)

Owner
Angel Lai
Simplicity Make Coding Prefect
Angel Lai
SleekwareDB is a NoSQL database storage service. A database storage service that can be used for various platforms and is easy to integrate.

SleekwareDB is a NoSQL database storage service. A database storage service that can be used for various platforms and is easy to integrate. NoSQL API

SleekwareDB 12 Dec 11, 2022
A complete, simple and powerful database framework written in PHP

BaseSQL BaseSQL is a complete database framework written in PHP. It was built to accelerate projects development by handle database connections and qu

Willian Pinheiro 2 Sep 21, 2021
The fastest pure PHP database framework with a powerful static code generator, supports horizontal scale up, designed for PHP7

Maghead 4.0.x IS CURRENTLY UNDER HEAVY DEVELOPMENT, API IS NOT STABLE Maghead is an open-source Object-Relational Mapping (ORM) designed for PHP7. Mag

Maghead 477 Dec 24, 2022
The Enobrev\ORM library is a small framework of classes meant to be used for simply mapping a mysql database to PHP classes, and for creating simply SQL statements using those classes.

The Enobrev\ORM library is a small framework of classes meant to be used for simply mapping a mysql database to PHP classes, and for creating simply SQL statements using those classes.

Mark Armendariz 0 Jan 7, 2022
[READ-ONLY] A flexible, lightweight and powerful Object-Relational Mapper for PHP, implemented using the DataMapper pattern. This repo is a split of the main code that can be found in https://github.com/cakephp/cakephp

CakePHP ORM The CakePHP ORM provides a powerful and flexible way to work with relational databases. Using a datamapper pattern the ORM allows you to m

CakePHP 146 Sep 28, 2022
[READ ONLY] Subtree split of the Illuminate Database component (see laravel/framework)

Illuminate Database The Illuminate Database component is a full database toolkit for PHP, providing an expressive query builder, ActiveRecord style OR

The Laravel Components 2.5k Dec 27, 2022
Adjacency List’ed Closure Table database design pattern implementation for the Laravel framework.

ClosureTable This is a database manipulation package for the Laravel 5.4+ framework. You may want to use it when you need to store and operate hierarc

Yan Ivanov 441 Dec 11, 2022
Phpstan-dba - database handling related class reflection extension for PHPStan & framework-specific rules

database handling class reflection extension for PHPStan This extension provides following features: PDO->query knows the array shape of the returned

Markus Staab 175 Dec 29, 2022
This package provides a framework-agnostic database backup manager for dumping to and restoring databases from S3, Dropbox, FTP, SFTP, and Rackspace Cloud

Database Backup Manager This package provides a framework-agnostic database backup manager for dumping to and restoring databases from S3, Dropbox, FT

Backup Manager 1.6k Dec 23, 2022
A lightweight nearly-zero-configuration object-relational mapper and fluent query builder for PHP5.

Idiorm http://j4mie.github.com/idiormandparis/ Feature/API complete Idiorm is now considered to be feature complete as of version 1.5.0. Whilst it wil

Jamie Matthews 2k Dec 27, 2022
PHP Database Migrations for Everyone

Phinx: Simple PHP Database Migrations Intro Phinx makes it ridiculously easy to manage the database migrations for your PHP app. In less than 5 minute

CakePHP 4.3k Jan 7, 2023
Database management in a single PHP file

Adminer - Database management in a single PHP file Adminer Editor - Data manipulation for end-users https://www.adminer.org/ Supports: MySQL, MariaDB

Jakub Vrána 5.5k Jan 1, 2023
A php class for managing and connecting to a database

Query builder class php This class is responsible for creating and executing sql commands and helps you to execute as easily as possible and safely. I

Mohammad Qasemi 39 Dec 11, 2022
Database lookup tool in php, skidlookup has not been claimed so if u want to use this src all right's go to u, idea came from fedsearch

skidlookup Database lookup tool in php, skidlookup has not been claimed so if u want to use this src, all right's go to u, idea came from fedsearch in

Nano 12 Dec 1, 2021
Connect and work with MySQL/MariaDB database through MySQLi in PHP. This is an introductory project, If you need a simple and straightforward example that takes you straight to the point, you can check out these examples.

First MySQLi PHP Connect and work with MySQL/MariaDB database through MySQLi in PHP. The above exercises are designed for students. This is an introdu

Max Base 4 Feb 22, 2022
Database lookup tool in php, skidlookup has not been claimed so if u want to use this src all right's go to u, idea came from fedsearch

skidlookup Database lookup tool in php, skidlookup has not been claimed so if u want to use this src, all right's go to u, idea came from fedsearch in

Nano 12 Dec 1, 2021
phpSleekDBAdmin - a web-based SleekDB database admin tool written in PHP

phpSleekDBAdmin is a web-based SleekDB database admin tool written in PHP. Following in the spirit of the flat-file system used by SleekDB, phpSleekDBAdmin consists of a single source file, phpsleekdbadmin.php. The interface and user experience is comparable to that of phpLiteAdmin and phpMyAdmin.

GalAnonym 8 Oct 26, 2022
PHP Reader for the MaxMind DB Database Format

This is the PHP API for reading MaxMind DB files. MaxMind DB is a binary file format that stores data indexed by IP address subnets (IPv4 or IPv6).

MaxMind 577 Dec 26, 2022
PHP application-level database locking mechanisms to implement concurrency control patterns.

PHP DB Locker Introduction PHP application-level database locking mechanisms to implement concurrency control patterns. Supported drivers: Postgres In

cybercog 3 Sep 29, 2022