本文整理汇总了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;
}
示例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的使用
示例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']);
}
});