php - How to separate a while loop into pages using only one script? -
I am currently creating a survey-type system in which the system uses a one-time loop, Displays the number. Unfortunately, I do not know how to create a page and instead, I can completely loop it into a full-page script.
Here's my code:
while ($ fetch = mysql_fetch_array ($ query1)) {// code here ($ fetch = mysql_fetch_array ($ query2)) { // Reply if (isset ($ _ POST ['voted']) {if_array ($ _POST ['scores ('. $ Fetch ['questionID']. ')'], $ Radio value)) {} Other {$ Miss ++; } $ Checker = true; }} // Check if the radio button is missed if ($ checker == true) {if ($ $$$$ lines $$$ is missing & lt; $ rows & $ miss! = 0 ) {Echo " all items are required
"; } And {// some code here}} $ query = mysql_query ("Select * from question"); While ($ fetch = mysql_fetch_array ($ query)) // displays the question with the question number // some code here shows a radio button from // 1 to 5 / there are some code here}} By default, my code is a loop of one time loop
within a short time: To make it clear, I am saying that Loop iterations in loops Of
So basically, what I have to do
Nominated 1 performance question (1 to 9)
Next button
Named 2 display questions (1 to 9) then
Additionally, the fetch_array command will be repeated again based on the number of items collected.
You should use LIMIT in your SQL query, and receive that page question list To
Something: SELECT * LIMIT 0, 10 will get the first 10 questions by questions I will recomme to read Microsoft ND: and mysql _ * Php functions also do not not , they are deleted, PDO or mysqli _ * / code> function < / Html>
Comments
Post a Comment