本文整理汇总了PHP中Quiz::removeOptionMulti方法的典型用法代码示例。如果您正苦于以下问题:PHP Quiz::removeOptionMulti方法的具体用法?PHP Quiz::removeOptionMulti怎么用?PHP Quiz::removeOptionMulti使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Quiz
的用法示例。
在下文中一共展示了Quiz::removeOptionMulti方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sprintf
$option_id = $_GET['option'];
//to delete multiple options rows in accurate mode. yl 15oct
$question_id = $_GET['questionNumber'];
//prepare option
$singleOptionSQL = sprintf("SELECT `option` FROM q_options_multi WHERE `option_id` = %d AND `fk_question_id` = %d LIMIT 1", $option_id, $question_id);
$singleOptionID = mysql_query($singleOptionSQL, $quizroo) or die(mysql_error());
$row_singleOptionID = mysql_fetch_assoc($singleOptionID);
do {
$singleOptionString = $row_singleOptionID['option'];
} while ($row_singleOptionID = mysql_fetch_assoc($singleOptionID));
//prepare option
$optionSQL = sprintf("SELECT `option_id` FROM q_options_multi WHERE `fk_question_id` = %d AND `option` = %s", GetSQLValueString($question_id, "int"), htmlentities(GetSQLValueString($singleOptionString, "text")));
$optionID = mysql_query($optionSQL, $quizroo) or die(mysql_error());
$row_optionID = mysql_fetch_assoc($optionID);
do {
if (!$quiz->removeOptionMulti($row_optionID['option_id'], $member->id)) {
echo "Delete not authorized";
}
} while ($row_optionID = mysql_fetch_assoc($optionID));
} else {
// get result number
$question = $_GET['questionNumber'];
$option = $_GET['optionNumber'];
$quiz = $_GET['id'];
// prepare result options
$querySQL = "SELECT result_id, result_title FROM q_results_multi WHERE fk_quiz_id = " . GetSQLValueString($quiz, "int");
$resultID = mysql_query($querySQL, $quizroo) or die(mysql_error());
$row_resultID = mysql_fetch_assoc($resultID);
$results = array();
do {
$results[] = array($row_resultID['result_id'], $row_resultID['result_title']);