PHP code example of awheel / medoo-model
1. Go to this page and download the library: Download awheel/medoo-model library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
awheel / medoo-model example snippets
`
$user = new User(); // User 参见 example/User.php
// 插入
$id = $user->insert(['name' => 'test', 'email' => '[email protected]', 'password' => md5('1234')]);
// 查找
$userInfo = $user->find($id);
// 更新
$count = $user->update(['name' => 'test2'], ['id' => $id]);
// 删除
$status = $user->delete(['id' => $id]);
// 自增
$count = $user->update(['level[+]' => 5], ['id' => $id]);
// 自减
$count = $user->update(['level[-]' => 5], ['id' => $id]);
// 更多使用参考: http://medoo.in/api/