Jump to content


Photo

Limit items per page


  • Please log in to reply
4 replies to this topic

#1 jcstanley

jcstanley
  • Members
  • PipPipPip
  • Advanced Member
  • 74 posts

Posted 12 October 2006 - 02:46 PM

Hi

I was wondering if you guys could point me in the right direction.

I currently have a page that displays every news item, but it is now getting very slow to load!

I was thinking of maybe displaying, say 10 items per page, but i am not quite sure how to do this.

Any help would be appreciated.

Thanks

#2 HuggieBear

HuggieBear
  • Members
  • PipPipPip
  • Advanced Member
  • 1,899 posts
  • LocationEngland, UK

Posted 12 October 2006 - 02:58 PM

Give this PHPFreaks tutorial a try...

Regards
Huggie
Advice to MySQL users: Get phpMyAdmin and test your queries work there first, take half the hassle out of diagnosis, also check the reserved words list.

Links: PHP Docs :: RegEx's :: MySQL :: DevGuru :: w3schools

#3 jcstanley

jcstanley
  • Members
  • PipPipPip
  • Advanced Member
  • 74 posts

Posted 13 October 2006 - 06:55 PM

Thanks, that tutorial really helped

I have just one question.  When displaying the results, how would i get it to display a picture?

It currently shows the TITLE and DESCRIPTION fine but i can't seem to figure out how to display a picture.

Here is my code:


echo'<font face="Tahoma" style="font-size: 11pt" color="#FFFFFF">'; echo $row['title']."</font></b></td>";

    echo'<td width="195" style="border-style:none; border-width:medium; " height="8" rowspan="2" valign="top">';

echo'<p align="center">'; echo '<img border="0"'; echo $row['picture']."</td>";
  echo'</tr>';
  echo'<tr>';
  echo'<td width="680" style="border-style:none; border-width:medium; " height="1">';

echo'<p style="margin-top: 0; margin-bottom: 0"><font face="Tahoma" size="2">'; echo $row['description']."</font></td>";



#4 craygo

craygo
  • Staff Alumni
  • Advanced Member
  • 1,973 posts
  • LocationRhode Island

Posted 13 October 2006 - 07:02 PM

you have to give the source for the picture. If the field "picture" contains the link then you can do it like so

   echo'<p align="center">'; 
echo '<img src="'.$row['picture'].'" border="0"'></td>';

If it does not contain the link, Where does it come from??
Ray


#5 jcstanley

jcstanley
  • Members
  • PipPipPip
  • Advanced Member
  • 74 posts

Posted 13 October 2006 - 07:25 PM

thanks for that, everything is fine now  :)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users