当前位置: 首页>>代码示例>>PHP>>正文


PHP medoo::last_query方法代码示例

本文整理汇总了PHP中medoo::last_query方法的典型用法代码示例。如果您正苦于以下问题:PHP medoo::last_query方法的具体用法?PHP medoo::last_query怎么用?PHP medoo::last_query使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在medoo的用法示例。


在下文中一共展示了medoo::last_query方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: last_query

 /**
  * @return array
  */
 public function last_query()
 {
     $rt = array('write' => $this->_writer->last_query(), 'read' => NULL);
     if (empty($this->_reader)) {
         $rt['read'] = $rt['write'];
     } else {
         $rt['read'] = $this->_reader->last_query();
     }
     return $rt;
 }
开发者ID:dalinhuang,项目名称:StudentManage,代码行数:13,代码来源:sql.php

示例2: medoo

 */
echo "_______________\n";
$database = new medoo('meetingmanage');
print_r($database->info());
/*
 * 查看错误信息
 */
echo "_______________\n";
$database->select("bccount", array("user_name", "email"), array("user_id[<]" => 20));
var_dump($database->error());
/*
 * 查看上一条query
 */
echo "_______________\n";
$last_user_id = $database->insert("test", array("user" => "fooa", "email" => "foo@bar.com", "id" => 25, "pwd" => "smart", "name" => array("en", "fr", "jp", "cn")));
echo $database->last_query();
/*
 * quote函数,单引号
 */
echo "_______________\n";
$data = "Medoo";
echo "we love" . $data . "\n";
echo "we love" . $database->quote($data);
/*
 * query()函数
 */
echo "_______________\n";
$data1 = $database->query("select * from test")->fetchAll();
print_r($data1);
/*
 * where的使用
开发者ID:keensting,项目名称:MeetingManageSystem,代码行数:31,代码来源:testmedoo.php

示例3: function

        $app->render(200, ['line' => $line]);
    }
});
// Delete Invoice
$app->delete('/api/invoices/:id', 'APIrequest', function ($id) use($app) {
    // Connect
    global $dbCredentials;
    $database = new medoo($dbCredentials);
    // Insert
    $database->delete('invoice', ['id' => $id]);
    $error = $database->error();
    if ($error[1]) {
        $app->render(500, ['error' => true, 'message' => $error[2], 'query' => $database->last_query()]);
    } else {
        $app->render(200, ['message' => 'deleted']);
    }
});
// Delete Invoice Line
$app->delete('/api/invoices/:invoice_id/lines/:line_id', 'APIrequest', function ($invoice_id, $line_id) use($app) {
    // Connect
    global $dbCredentials;
    $database = new medoo($dbCredentials);
    // Insert
    $database->delete('line', ['AND' => ['id' => $line_id, 'invoice_id' => $invoice_id]]);
    $error = $database->error();
    if ($error[1]) {
        $app->render(500, ['error' => true, 'message' => $error[2], 'query' => $database->last_query()]);
    } else {
        $app->render(200, ['message' => 'deleted']);
    }
});
开发者ID:scriptist,项目名称:invoice.scripti.st,代码行数:31,代码来源:admin-api.php


注:本文中的medoo::last_query方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。