In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly introduces "the example introduction of adding, deleting, modifying and querying the PHP lightweight database operation class Medoo". In the daily operation, it is believed that many people have doubts about the example introduction of the PHP lightweight database operation class Medoo addition, deletion, modification and query. The editor consulted all kinds of data and sorted out simple and useful operation methods. Hope to answer "PHP lightweight database operation class Medoo add, delete, modify, query example introduction" is helpful! Next, please follow the editor to study!
Medoo introduction
Medoo is an ultra-lightweight PHP SQL database framework developed by Li Yanzhuo, founder of social networking site Catfan and open source project Qatrix. Provides a simple, easy to learn, flexible API, to improve the efficiency and performance of the development of Web applications, and the volume is only less than 8KB.
Characteristics
Lightweight, only one file
Easy to learn, data structure is clear at a glance
Support for multiple SQL syntax and support for complex query conditions
Supports a variety of databases, including MySQL, MSSQL, SQLite, etc.
Safe to prevent SQL injection
Free, based on MIT protocol
Sample code
Increase
The copy code is as follows:
$database = new medoo ("my_database")
$last_user_id = $database- > insert ("account", [
"user_name" = > "foo"
"email" = > "foo@bar.com"
"age" = > 25
"lang" = > [
"en"
"fr"
"jp"
"cn"
]
])
Delete
The copy code is as follows:
$database = new medoo ("my_database")
$database- > delete ("account", [
"AND" = > [
"type" = > "business"
"age []" = > 100
])
/ / $datas = array (
/ / [0] = > array (
/ / "user_name" = > "foo"
/ / "email" = > "foo@bar.com"
/ /)
/ / [1] = > array (
/ / "user_name" = > "cat"
/ / "email" = > "cat@dog.com"
/ /)
/ /)
Foreach ($datas as $data) {
Echo "user_name:". $data ["user_name"]. -email: $data ["email"]. "
"
}
/ / Select all columns
$datas = $database- > select ("account", "*")
/ / Select a column
$datas = $database- > select ("account", "user_name")
/ / $datas = array (
/ / [0] = > "foo"
/ / [1] = > "cat"
/ /)
At this point, on the "PHP lightweight database operation class Medoo add, delete, modify, query example introduction" study is over, I hope to be able to solve everyone's doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.