Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-08-01 12:22:13

anthonybooth
Member
From: UK
Registered: 2007-01-13
Posts: 21
Website

safe_rows limit offset, maxrows

Help please

I putting together a plugin where I require ‘x’ amount of records to be shown on each page using the limit with an $offset and $maxrows value.

If the number of records retrieved is less than the $maxrows it repeats the retrieved records until it reaches the $maxrow amount??

Am I being thick or is this the way safe_rows works.

The sizeof($rs) is showing the value of $maxrows not the amount of records found.


Forever learning.

Offline

#2 2007-08-01 13:42:29

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: safe_rows limit offset, maxrows

Can you set the fourth parameter in the safe_rows call (debug) to 1 or TRUE and post the SQL query that is displayed in the browser?

Offline

#3 2007-08-01 14:10:24

anthonybooth
Member
From: UK
Registered: 2007-01-13
Posts: 21
Website

Re: safe_rows limit offset, maxrows

Opps I forgot about the debug setting. I have noticed from the outputted SQL query that a join was missing on one the 3 tables.

Sometimes I wish I had a simpler job.

Thanks for kicking my brain in gear. That’s one reason I love txp the community is great.


Forever learning.

Offline

Board footer

Powered by FluxBB