I have the following (stripped down) code:
$question = fetch_question($conn, $current_question);
var_dump($question);
echo $question["_id"];
fetch_question() uses $conn database connection to retrieve an array on $current_question.
This gives me the following output:
array(1) {
[0]=>
array(7) {
["_id"]=>
string(1) "1"
["question"]=>
string(10) "What's 2+2"
["answer1"]=>
string(1) "1"
["answer2"]=>
string(1) "2"
["answer3"]=>
string(1) "3"
["answer4"]=>
string(1) "4"
["is_right"]=>
string(1) "4"
}
}
<br />
<b>Notice</b>: Undefined index: _id in <b>D:\Websites\htdocs\tests\general.php</b> on line <b>76</b><br />
Now I find this very peculiar, _id is clearly defined I have no idea what makes PHP behave like this!
Any help would be appreciated!