Jump to content


Photo

Help needed with pagination


  • Please log in to reply
1 reply to this topic

#1 xyn

xyn
  • Members
  • PipPipPip
  • Advanced Member
  • 779 posts
  • LocationNorthampton

Posted 19 October 2006 - 11:05 AM

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:
<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>');
?>


#2 Daniel0

Daniel0
  • Staff Alumni
  • Advanced Member
  • 11,956 posts

Posted 19 October 2006 - 11:53 AM

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:

a) DON'T Describe your question or problem as urgent, super important, must have by tommorrow etc...






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users