Jump to content

Results in Pages


gokhul

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.