Medoo PHP Database Operation class

Source: Internet
Author: User
Tags php database sqlite database
Medoo is a lightweight PHP database framework class that accelerates website development! Medoo can greatly speed up the development of your PHP project. In web development, a large part of the enterprise or individual will choose to use the PHP language, and Medoo can play a icing on the cake. Shorten your development cycle. Medoo's powerful and sophisticated API not only fits your most basic needs, but is also very simple to use. Even if you have to develop two times, there is no problem.

First, Medoo environmental needs

(1), PHP 5.1 or above and enable PDO support

(2), support Mysql,mssql,sqlite database, or more other databases.

(3), ensure that the database PDO extension is installed and enabled in PHP.ini.

Second, the use of Medoo

(1), MySQL in Medoo use

require ' medoo.php ';
$database = new Medoo (Array (
Must-Choose
' Database_type ' = ' mysql ',
' database_name ' = ' name ',
' Server ' = ' localhost ',
' Username ' = ' your_username ',
' Password ' = ' Your_password ',
Options available
' Port ' = 3306,
' CharSet ' = ' utf8 ',
DB connection Drive Options
' option ' = = Array (
Pdo::attr_case = Pdo::case_natural
)));

(2), Medoo use in SQLite

Require_once ' medoo.php ';
$database = new Medoo ([
' Database_type ' = ' SQLite ',
' Database_file ' = ' my/database/path/database.db ']
);
$database->insert ("Account", [
"User_name" = "foo",
"Email" = "foo@bar.com"]
);

Project Address: http://medoo.in/

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.