Jump to content

Recommended Posts

Hello,

 

Can anyone tell me about how to get the results in different pages?

Right now, I am getting all the results in a single page, making it difficult for me to go through them.

I want to get a particular number of results on a single page.

The following is the code which I am using to get the results.

 

 

 

 

 

$ncols=mysql_num_fields($result);/* How many columns (fields) */

$queryResults = NULL;

if( mysql_num_rows($result)>0)

{

print "<br>";

print "<table cellpadding=0 cellspacing=0 width=100% border=1 bordercolor=skyblue>";

print "<tr>";

for ( $i=0; $i<$ncols; $i++ )

{

$column_name=mysql_field_name($result,$i); /* field name */

print "<td align=center><b>".$column_name."</b></td>";

}

print "</tr>";

$total=0;

while ( $row = mysql_fetch_array($result) ) /* process result row-by-row */

{

print "<tr>";

$total++;

for ( $i=0; $i<$ncols; $i++ )

{

 

        $column_value=$row[$i];            /* field value */                             

              print "<td align=center>".$column_value . "</td>";

}

}

mysql_free_result($result);

}

else

{

echo ("<h3>There is no data pertaining to your request</h3>");

}

?>

  </table>                                                       

<br>

<br>

 

</form>         

</div>

 

           

           

           

           

           

            </td>

          </tr>

        </table></td>

      <td valign="top">  </td>

    </tr>

  </table>

  <table width="648" border="0" cellspacing="0" cellpadding="0">

 

  </table>

  <br>

</div>

</body>

</html>

Link to comment
https://forums.phpfreaks.com/topic/162381-results-in-pages/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.