Jump to content

Archived

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

xyn

Help needed with pagination

Recommended Posts

Hey,
I've been trying to make this scruipt work for 2 weeks now,
and I've got nowhere. Basicalyl i have a pagination script it
allows to show 8 profiles per page in a table made of 4 columns
and 2 rows.

I then was advised to use mysql_result() toextract the information
well This is where i'm stuck. If i have 9 profiles. thats 2 pages, then
I want page 1 full and page 2 to show 1 profile and the other 7 spots
are left blank, Yet this is where i am ahving issues; My problems are:
1. I don't know where to start.
2. I can'tg et PHP to check how many posts for that page.
3. how to set the NULL rows to BLANK
4. i'm confused :l

My code:
[code=php:0]<p><span class="heading">Eumod UK Biographies</span><br>
<span class="text">Welcome to the Eumod UK Biographies, these bios' where created by the vehicle
original owners, Click the thumbnail for the main biography view, Members may
leave reviews, rate the biography, and send the biography to their friends.
Unregistered members must register for these special privileges, it's 100% free
and will not take any longer than 2 minutes.</span></p>
<?PHP
//
// Get Variables
//
$SQL = mysql_query("SELECT bio_image,bio_car,bio_model,bio_name FROM bio WHERE bio_auth='y' AND bio_done='y'");
$NUM = mysql_num_rows( $SQL );

//
// Check for amount of rows
//
foreach( $NUM as $key => $row )
{
$av[$row] = mysql_result("$SQL", "$row", 'bio_avatar');
}

//
// Create Table
//
echo ('<div align="center">
  <center>
  <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="470">
    <tr>
      <td width="110">
      <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="110" height="104">
        <tr>
          <td width="100%">
          <p align="center">nnnn</p>
          </td>
        </tr>
      </table>
      </td>
      <td width="10">&nbsp;</td>
      <td width="110">
      <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="110" height="104">
        <tr>
          <td width="100%">
          <p align="center">nnnn</p>
          </td>
        </tr>
      </table>
      </td>
      <td width="10">&nbsp;</td>
      <td width="110">
      <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="110" height="104">
        <tr>
          <td width="100%">
          <p align="center">nnnn</p>
          </td>
        </tr>
      </table>
      </td>
      <td width="10">&nbsp;</td>
      <td width="110">
      <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="110" height="104">
        <tr>
          <td width="100%">
          <p align="center">nnnn</p>
          </td>
        </tr>
      </table>
      </td>
    </tr>
    <tr>
      <td width="110" height="10"></td>
      <td width="10" height="10"></td>
      <td width="110" height="10"></td>
      <td width="10" height="10"></td>
      <td width="110" height="10"></td>
      <td width="10" height="10"></td>
      <td width="110" height="10"></td>
    </tr>
    <tr>
      <td width="110" height="24">
      <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="110" height="24">
        <tr>
          <td width="100%">
          <p align="center">Heading</p>
          </td>
        </tr>
      </table>
      </td>
      <td width="10" height="24">&nbsp;</td>
      <td width="110" height="24">
      <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="110" height="24">
        <tr>
          <td width="100%">
          <p align="center">Heading</p>
          </td>
        </tr>
      </table>
      </td>
      <td width="10" height="24">&nbsp;</td>
      <td width="110" height="24">
      <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="110" height="24">
        <tr>
          <td width="100%">
          <p align="center">Heading</p>
          </td>
        </tr>
      </table>
      </td>
      <td width="10" height="24">&nbsp;</td>
      <td width="110" height="24">
      <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="110" height="24">
        <tr>
          <td width="100%">
          <p align="center">Heading</p>
          </td>
        </tr>
      </table>
      </td>
    </tr>
    <tr>
      <td width="470" colspan="7" height="10"></td>
    </tr>
    <tr>
      <td width="110">
      <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="110" height="104">
        <tr>
          <td width="100%">
          <p align="center">nnnn</p>
          </td>
        </tr>
      </table>
      </td>
      <td width="10">&nbsp;</td>
      <td width="110">
      <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="110" height="104">
        <tr>
          <td width="100%">
          <p align="center">nnnn</p>
          </td>
        </tr>
      </table>
      </td>
      <td width="10">&nbsp;</td>
      <td width="110">
      <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="110" height="104">
        <tr>
          <td width="100%">
          <p align="center">nnnn</p>
          </td>
        </tr>
      </table>
      </td>
      <td width="10">&nbsp;</td>
      <td width="110">
      <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="110" height="104">
        <tr>
          <td width="100%">
          <p align="center">nnnn</p>
          </td>
        </tr>
      </table>
      </td>
    </tr>
    <tr>
      <td width="110" height="10"></td>
      <td width="10" height="10"></td>
      <td width="110" height="10"></td>
      <td width="10" height="10"></td>
      <td width="110" height="10"></td>
      <td width="10" height="10"></td>
      <td width="110" height="10"></td>
    </tr>
    <tr>
      <td width="110" height="24">
      <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="110" height="24">
        <tr>
          <td width="100%">
          <p align="center">Heading</p>
          </td>
        </tr>
      </table>
      </td>
      <td width="10" height="24">&nbsp;</td>
      <td width="110" height="24">
      <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="110" height="24">
        <tr>
          <td width="100%">
          <p align="center">Heading</p>
          </td>
        </tr>
      </table>
      </td>
      <td width="10" height="24">&nbsp;</td>
      <td width="110" height="24">
      <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="110" height="24">
        <tr>
          <td width="100%">
          <p align="center">Heading</p>
          </td>
        </tr>
      </table>
      </td>
      <td width="10" height="24">&nbsp;</td>
      <td width="110" height="24">
      <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="110" height="24">
        <tr>
          <td width="100%">
          <p align="center">Heading</p>
          </td>
        </tr>
      </table>
      </td>
    </tr>
    <tr>
      <td width="470" height="20" colspan="7">
      &nbsp;</td>
    </tr>
    <tr>
      <td width="110" height="24" align="center" class="text">
      PREV</td>
      <td width="10" height="24" align="center" class="text">&nbsp;</td>
      <td width="230" height="24" align="center" colspan="3" class="text">
      &nbsp;PAGES</td>
      <td width="10" height="24" align="center" class="text">&nbsp;</td>
      <td width="110" height="24" align="center" class="text">
      NEXT</td>
    </tr>
  </table>
  </center>
</div>');
?>[/code]

Share this post


Link to post
Share on other sites
I believe you have been a member for long enough time that you should have read the posting guidelines. It clearly states that titles like yours aren't allowed: [quote=posting guidelines]a) DON'T Describe your question or problem as urgent, super important, must have by tommorrow etc...[/quote]

Share this post


Link to post
Share on other sites

×

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.