function getquestion($value)
{
global $conn;
//ถ้าค่าที่รับเข้ามา($value)มีค่า= ค่า id ที่อยู่ในฐานข้อมูลให้ทำคำสั่งข้างล่างนี้
$result = &$conn->Execute( "SELECT s.id as sid, s.sub_q_title as stitle, sc.id as scid,sc.question_id as scqid, sc.sub_q_choice_title as sctitle, s.full_score as sscore FROM sub_question_tb as s LEFT JOIN sub_question_choice_tb as sc ON s.id = sc.question_id WHERE s.question_id = '$value' ORDER BY s.id ");
while (!$result->EOF) {
$refs[$result->fields['sid']]['id'] = $result->fields['sid'];
$refs[$result->fields['sid']]['title'] = $result->fields['stitle'];
$refs[$result->fields['sid']]['score'] = $result->fields['sscore'];
$arr_questions['questions_id'] = $result->fields['scqid'];
$arr_questions['title'] = $result->fields['sctitle'];
$refs[$result->fields['sid'] ]['questions_choice'][ $result->fields['scid'] ] = $arr_questions;
$result->MoveNext();
}
return $refs;
}
?>