Hi people as a new web programming im having a scenario and i need some help.
Im trying to have a 'next' button on the page which will pull the next question from the database in a iterative manner. im passing php values straight to the button as text.
Currently I can grab the mysql resultset and print them all or i can grab just the one row and return its fields but what is the strategy to grab one with the next button, then another, and so on.
$result = mysql_query("SELECT * FROM $DB_QUEST_NAME ORDER BY pk_Id DESC;") or die(mysql_error());
while ($row = mysql_fetch_array($result)){
echo $pk_id = $row[0] . "<br>";
echo $question = $row[1]. "<br>";
echo $answera = $row[2] . "<br>";
echo $answerb = $row[3] . "<br>";
echo $answerc = $row[4] . "<br>";
echo $answerd = $row[5] . "<br><br>";
break;
}
In the mark up include the getNextPoll.php (above) which initial grabs the first result to displays them as button. but with every subsequent click I want to get the next, then the next and so on. I know how to set the button texts and Im also aware of server side client side responsibilites but as Im quite new to this type of development the methodology behind it a lil tricky.
Any feedback would be appreciated. Thanks.