本文整理汇总了PHP中mysqli::put方法的典型用法代码示例。如果您正苦于以下问题:PHP mysqli::put方法的具体用法?PHP mysqli::put怎么用?PHP mysqli::put使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mysqli
的用法示例。
在下文中一共展示了mysqli::put方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: function
} else {
echo "0 results";
}
});
// add new item
$conn->post('/cakemail/todo_list/new_item', function () use($conn) {
$sql = "INSERT INTO todo_list (item_id, description, date_added, date_due, status) \n\t\tVALUES (DEFAULT, {$description}, {$date_added}, {$date_due}, {$status})";
//$result = $conn->query($sql);
if ($result->success() === TRUE) {
echo "Item added successfully";
} else {
echo "Error adding item: " . $conn->error;
}
});
// updated list based on item id
$conn->put('/cakemail/todo_list/update/{item_id}', function ($item_id) use($conn) {
});
// delete item
$conn->delete('/cakemail/todo_list/delete/{item_id:[0-9]+}', function ($item_id) use($conn) {
$sql = "DELETE FROM todo_list WHERE item_id = {$item_id}";
$result = $conn->query($sql);
if ($result->success() === TRUE) {
echo "Row deleted successfully";
} else {
echo "Error deleting row: " . $conn->error;
}
});
// delete list
$conn->delete('/cakemail/todo_list/delete', function () use($conn) {
$sql = "DROP TABLE todo_list";
$result = $conn->query($sql);
if ($result->success() === TRUE) {