Posted by Steve on 11/10/06 15:28
"davek" <news@smutchin.co.uk> wrote in message
news:1163171727.790425.217860@i42g2000cwa.googlegroups.com...
| Here's a simplified outline of what I want to achieve:
|
| $this = output of some mysql SELECT query;
| $rownum = 1;
|
| while ($this) {
|
| echo $this;
|
| if ($rownum % 15 == 0 AND [!LastRow]) {
| echo $that
| }
|
| $rownum++
| }
|
| It's the "[!LastRow]" that I am stuck on. Any thoughts?
what function are you using to do the db calls? most all of them have a
method to get the number of rows returned from a query.
$this = output of blah, blah, blah
$record = 1;
$lastRecord = mysql_num_rows($this);
while ($this)
{
echo $this;
if ($record % 15 == 0 && record != $lastRecord){ echo $that; }
}
Navigation:
[Reply to this message]
|