Search found 6 matches

by ijyoung
Wed Nov 15, 2006 4:58 pm
Forum: PHP - Code
Topic: Splitting list within a page
Replies: 8
Views: 464

Example (untested) $sql = "SELECT * FROM `yourTable`"; $result = mysql_query($result); $counter = 1; while($line = mysql_fetch_array($result, MYSQL_ASSOC)) { echo $line['someFieldName']; if(($counter % 5) == 0) { echo "back to top link here"; } $counter++; } Brilliant. works a t...
by ijyoung
Wed Nov 15, 2006 10:55 am
Forum: PHP - Code
Topic: Splitting list within a page
Replies: 8
Views: 464

Thanks.

This looks great. I'll try tomorrow as I am out this evening.

Ian
by ijyoung
Wed Nov 15, 2006 9:52 am
Forum: PHP - Code
Topic: Splitting list within a page
Replies: 8
Views: 464

Split the list - Sorted - after a fashion

I have sorted the problem for now, albeit a bit inelegantly by using separate queries and limits as follows: LIMIT 0,5 LIMIT 6,5 LIMIT 11,5 LIMIT 16,5 LIMIT 21,5 etc Anyone have a suggestion how we could accomplish this so that no matter how many records were called it would limit them in the above ...
by ijyoung
Wed Nov 15, 2006 8:36 am
Forum: PHP - Code
Topic: Splitting list within a page
Replies: 8
Views: 464

Ta.

Kinda obvious huh? :oops:

Ian
by ijyoung
Wed Nov 15, 2006 8:20 am
Forum: PHP - Code
Topic: Splitting list within a page
Replies: 8
Views: 464

Not sure the value of sending the code. It is a bog standard piece of php for paging results which works well enough for that.

I was looking for some code that would allow me to split the list but not paginate.

If you still want to see code then fair enough.

Where are posting guidelines?
by ijyoung
Wed Nov 15, 2006 7:28 am
Forum: PHP - Code
Topic: Splitting list within a page
Replies: 8
Views: 464

Splitting list within a page

I want to be able to split a list within a page so that I can insert an instruction after every 10 results or so

- for example a #top link.
I have tried to customise a paging script but that limits the number of results per page.

Any thought on how that could be achieved?

Ian