Any help might be enough to point me in the right direction,
Thanks
In a multi-dimensional array--
What code is used to get the next row say if you start at [0] => 4[id] =>4 and end at [0] => 8[id] =>8 ? ( I am not sure if this detail describes my goal, 'pointer control')
to leave and come back at the next row? variables?
How does the fetch/query syntax look?
this was generated with print_r($row); there are 8 rows -
Array (
[0] => 1 [id] => 1
[1] => 2 [questionID] => 2
[2] => You are standing the wheelwatch when you hear the cry _Man overboard starboard side_. You should: [question] =>
You are standing the wheelwatch when you hear the cry _Man overboard starboard side_. You should:
[3] => give full right rudder [A] => give full right rudder
[4] => give full left rudder => give full left rudder
[5] => put the rudder amidships [C] => put the rudder amidships
[6] => throw a life ring to mark the spot [D] => throw a life ring to mark the spot
)
I want to pointer control, which row in an array 6 col by 8 rows or more rows
I have 100 questions I want to take blocks of 20 questions at a time, then radio button choice A -> D to get next question.
//This worked to get first question.
/// connection to db above this
if (!$_POST) {
$row = mysql_fetch_array($result);
include ("questionTable.inc");
include ("inputForm.inc");
}
// This gave me the rest, but ALL the rest
if ($_POST) {
While ($row = mysql_fetch_array($result)){
//
if(next($row)){
include ("questionTable.inc");
include ("inputForm.inc");
}
}
}
?>
////
inputForm.inc
////
<?php
echo "<CENTER>";
echo "<br /><br /><br />";
echo
"<form name='f' form method = 'POST' >.
<Input name = 'RadioAn' type ='radio' value = 'A'>A.
<Input name = 'RadioAn' type ='radio' value = 'B'>B.
<Input name = 'RadioAn' type ='radio' value = 'C'>C.
<Input name = 'RadioAn' type ='radio' value = 'D'>D.
<Input name = 'a' type ='hidden' value = '$a'>\n"; // $a might be used to control pointer?
echo "<BR><BR>";
echo "<input type='submit' value='Submit Answer'><BR></FORM>\n";
echo "</CENTER>";
?>
Thanks
In a multi-dimensional array--
What code is used to get the next row say if you start at [0] => 4[id] =>4 and end at [0] => 8[id] =>8 ? ( I am not sure if this detail describes my goal, 'pointer control')
to leave and come back at the next row? variables?
How does the fetch/query syntax look?
this was generated with print_r($row); there are 8 rows -
Array (
[0] => 1 [id] => 1
[1] => 2 [questionID] => 2
[2] => You are standing the wheelwatch when you hear the cry _Man overboard starboard side_. You should: [question] =>
You are standing the wheelwatch when you hear the cry _Man overboard starboard side_. You should:
[3] => give full right rudder [A] => give full right rudder
[4] => give full left rudder => give full left rudder
[5] => put the rudder amidships [C] => put the rudder amidships
[6] => throw a life ring to mark the spot [D] => throw a life ring to mark the spot
)
I want to pointer control, which row in an array 6 col by 8 rows or more rows
I have 100 questions I want to take blocks of 20 questions at a time, then radio button choice A -> D to get next question.
//This worked to get first question.
/// connection to db above this
if (!$_POST) {
$row = mysql_fetch_array($result);
include ("questionTable.inc");
include ("inputForm.inc");
}
// This gave me the rest, but ALL the rest
if ($_POST) {
While ($row = mysql_fetch_array($result)){
//
if(next($row)){
include ("questionTable.inc");
include ("inputForm.inc");
}
}
}
?>
////
inputForm.inc
////
<?php
echo "<CENTER>";
echo "<br /><br /><br />";
echo
"<form name='f' form method = 'POST' >.
<Input name = 'RadioAn' type ='radio' value = 'A'>A.
<Input name = 'RadioAn' type ='radio' value = 'B'>B.
<Input name = 'RadioAn' type ='radio' value = 'C'>C.
<Input name = 'RadioAn' type ='radio' value = 'D'>D.
<Input name = 'a' type ='hidden' value = '$a'>\n"; // $a might be used to control pointer?
echo "<BR><BR>";
echo "<input type='submit' value='Submit Answer'><BR></FORM>\n";
echo "</CENTER>";
?>