本文整理汇总了PHP中Question::find_by_id方法的典型用法代码示例。如果您正苦于以下问题:PHP Question::find_by_id方法的具体用法?PHP Question::find_by_id怎么用?PHP Question::find_by_id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Question
的用法示例。
在下文中一共展示了Question::find_by_id方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: disable_survey
function disable_survey($id)
{
$question = Question::find_by_id($id);
$question->is_enabled = 'false';
$question->update();
echo "Survey disabled successfully...";
}
示例2: array
<?php
require_once "initialize.php";
$ja = array("id" => "nothing", "runda" => "nothing", "kategoria" => "nothing", "tresc" => "nothing", "odp_a" => "nothing", "odp_b" => "nothing", "odp_c" => "nothing", "odp_d" => "nothing", "poprawna" => "nothing", "link" => "nothing");
if (isset($_POST['id'])) {
$question = Question::find_by_id($_POST['id']);
$arr = array();
foreach ($question as $key => $value) {
$arr[] = $value;
}
$ja["id"] = $arr[0];
$ja["runda"] = $arr[4];
$ja["kategoria"] = $arr[5];
$ja["tresc"] = $arr[6];
$ja["odp_a"] = $arr[7];
$ja["odp_b"] = $arr[8];
$ja["odp_c"] = $arr[9];
$ja["odp_d"] = $arr[10];
$ja["poprawna"] = $arr[11];
$ja["link"] = $arr[12];
}
// return the value to jQuery via ajax to confirm if the login was succesful
echo json_encode($ja);
示例3: envapi_get_html_for_reg_user
$user = User::find_by_id($_SESSION['user_id']);
?>
<?php
$path = 'assets/images/profile_pic/' . $user->profile_pic;
echo envapi_get_html_for_reg_user('176644-3EaSQ9JhWGaxqDH2EJ91XS3smNIPajiD', $user->first_name, $user->last_name, $path, false, "HI");
?>
<?php
//Count the no. of unread messages...
$count = User::count_unread_messages($_SESSION['user_id']);
?>
<?php
if (isset($_GET['id'])) {
$question = Question::find_by_id($_GET['id']);
if ($question == '') {
redirect_to('extra-404');
}
}
?>
<?php
if (isset($_POST['submit_option'])) {
$survey_data_obj = new SurveyData();
$survey_data_obj->respondent_id = $_SESSION['user_id'];
$survey_data_obj->question_id = $_GET['id'];
$survey_data_obj->option_id = $_POST['user_response'];
$survey_data_obj->create();
}
?>