Using Brian's suggestion below:
foreach($qs as $value){
echo "<tr>".$value['qnum']." is the questions number and the question text is ".$value['qtext'].". The page and q values are ".$value['page']." and ".$value['questions']." respectively.</tr>";
}
I get the following output from the array, which isn't right:
8 is the questions number and the question text is I know how what I do fits into my team's objectives. The page and q values are 1 and q8 respectively.8 is the questions number and the question text is I know how what I do fits into my team's objectives. The page and q values are 1 and q8 respectively.8 is the questions number and the question text is I know how what I do fits into my team's objectives. The page and q values are 1 and q8 respectively.8 is the questions number and the question text is I know how what I do fits into my team's objectives. The page and q values are 1 and q8 respectively.8 is the questions number and the question text is I know how what I do fits into my team's objectives. The page and q values are 1 and q8 respectively.8 is the questions number and the question text is I know how what I do fits into my team's objectives. The page and q values are 1 and q8 respectively.8 is the questions number and the question text is I know how what I do fits into my team's objectives. The page and q values are 1 and q8 respectively.8 is the questions number and the question text is I know how what I do fits into my team's objectives. The page and q values are 1 and q8 respectively
Any further suggestions.
Homer.
Hi again,
Thanks in advance for the help.
Here is my array based on $rowq
:
Array (
[0] => Array (
[questions] => q8
[qnum] => 8
[qtext] => I know how what I do fits into my team's objectives
[page] => 1
)
[1] => Array (
[questions] => q8
[qnum] => 8
[qtext] => I know how what I do fits into my team's objectives
[page] => 1
)
[2] => Array (
[questions] => q8
[qnum] => 8
[qtext] => I know how what I do fits into my team's objectives
[page] => 1
)
[3] => Array (
[questions] => q8
[qnum] => 8
[qtext] => I know how what I do fits into my team's objectives
[page] => 1
)
[4] => Array (
[questions] => q8
[qnum] => 8
[qtext] => I know how what I do fits into my team's objectives
[page] => 1
)
[5] => Array (
[questions] => q8
[qnum] => 8
[qtext] => I know how what I do fits into my team's objectives
[page] => 1
)
[6] => Array (
[questions] => q8
[qnum] => 8
[qtext] => I know how what I do fits into my team's objectives
[page] => 1
)
[7] => Array (
[questions] => q8
[qnum] => 8
[qtext] => I know how what I do fits into my team's objectives
[page] => 1
)
)
I would like to display elements of the array, looping through each row using (i think) the foreach
statement but I can't get it working, ideally, I would like to echo something like this
echo "<tr>".$rowq[qnum]." is the questions number and the question text is ".$rowq[qtext].". The page and q values are ".$rowq[page]." and ".$rowq[questions]." respectively.";
And that link of text would appear however many rows the array has in it.
Any and all advice appreciated - I'm struggling like heck to get my head around multi-dimensional arrays :(
Homer.