本文整理汇总了PHP中Tasks::fetch方法的典型用法代码示例。如果您正苦于以下问题:PHP Tasks::fetch方法的具体用法?PHP Tasks::fetch怎么用?PHP Tasks::fetch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tasks
的用法示例。
在下文中一共展示了Tasks::fetch方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Tasks
$('.close-button').click(function(){
$('#table_overlay').fadeOut('fast');
$('#table_overlay_div').fadeOut('fast');
});
});
</script>
</head>
<body>
<?php
/**
*function to view all task
*/
include "Tasks.php";
$obj = new Tasks();
$obj->viewTasks();
if (!($row = $obj->fetch())) {
echo "there are no tasks currently";
}
/**
*Setting a table to contain the contents of tasks objects
*/
echo "<table border='2'>";
echo "<tr><td>TASK ID</td><td>TASK NAME</td><td>TASK DESCRIPTION</td><td>START DATE</td>\n <td>END DATE</td><td>LOCATION</td></tr>";
while ($row) {
echo "<tr><td>{$row["task_id"]}</td><td><a href=tasksdisplayselected.php?id=" . $row["task_name"] . ">{$row["task_name"]}</td>";
echo "<td>{$row["task_description"]}</td><td>{$row["start_date"]}</td>\n <td>{$row["end_date"]}</td><td>{$row["location"]}</td>";
$row = $obj->fetch();
}
echo "</table>";
?>
</div>
示例2: Tasks
*COde standard: PSR
*function to retrieve and display the tasks that have been assigned to nurses
*The method fetches the details of the task
*The method prints to screen an error message when query fails
*/
include_once "Tasks.php";
$obj = new Tasks();
$obj->displayAllTasks();
if (!($row = $objnurse->fetch())) {
echo "There are no tasks currently";
}
/**
*Creating code to display a table to contain the contents of tasks objects
*
*The details of the tasks that are printed in a table.
*There's a loop that echoes the details of the task.
*The loop steps through all the task and fetches in rows
*/
echo "<center><table border='1'>";
echo "<tr><td>task_id</td><td>task_name</td><td>task_description</td><td>start_date</td>\n\t <td>end_date</td><td>location</td></tr>";
while ($row) {
echo "<tr><td>{$row['task_id']}</td><td>{$row['task_name']}</td><td>{$row['task_description']}</td>";
echo "<td>{$row['start_date']}</td><td>{$row['end_date']}</td><td>{$row['location']}</td></tr>";
$row = $obj->fetch();
}
echo "</table></center>";
?>
</div>
</body>
</html>