本文整理匯總了PHP中DataHandler::get_cardio_by_id方法的典型用法代碼示例。如果您正苦於以下問題:PHP DataHandler::get_cardio_by_id方法的具體用法?PHP DataHandler::get_cardio_by_id怎麽用?PHP DataHandler::get_cardio_by_id使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DataHandler
的用法示例。
在下文中一共展示了DataHandler::get_cardio_by_id方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: DataHandler
<p>Edit Cardio:<br><br></p>
<?php
require_once 'library/DataHandler.php';
$id = $_GET['id'];
$dh = new DataHandler();
$cardio = $dh->get_cardio_by_id($id);
$exercise = $cardio->get_name();
$time = $cardio->get_time();
$distance = $cardio->get_distance();
$level = $cardio->get_level();
$date = $cardio->get_date();
echo "<form action=\"index.php\" method=\"post\">\n <p>Exercise:</p>\n <input type=\"text\" name=\"exercise\" value = \"{$exercise}\" size=\"10\" ><br><br>\n <p>Time (minutes):</p>\n <input type=\"text\" name=\"time\" value = \"{$time}\" size=\"10\" ><br><br>\n <p>distance (miles):</p>\n <input type=\"text\" name=\"distance\" value = \"{$distance}\" size=\"10\" ><br><br>\n <p>level:</p>\n <input type=\"text\" name=\"level\" value = \"{$level}\" size=\"10\" ><br><br>\n <p>Date:</p>\n <input type=\"text\" name=\"date\" value = \"{$date}\" size=\"10\" ><br><br>\n <input type=\"submit\" value=\"Update\" >\n <input type=\"hidden\" value=\"{$id}\" name=\"id\" >\n <input type=\"hidden\" value=\"action/update_cardio\" name=\"content\" >\n </form>";
?>
示例2: get_cardio_by_id
/**
* Returns a Cardio object
*
* @param int $cardio_id
* @return Cardio $cardio A Cardio object
*
*/
public function get_cardio_by_id($cardio_id)
{
$dh = new DataHandler();
return $dh->get_cardio_by_id($cardio_id);
}