-
☆ A M B ☆
- 24,524 Posts
That should be done in the query, unless you will also be wanting to use the other query results elsewhere.
As it is, you could use a for() loop,
for($i=0;$i<10;$i+=8) { // start at 0, skip from 0-8 and pick up 9 (counting from 0), stop the loop.
...
}
or something like that, I don’t think that’s quite right, but should get the idea across.
A while loop would do much the same thing; I just tend to think in terms of for loops.
Found this in the PHP manual:
[tt]<?php
$link = mysql_connect(’localhost’, ’mysql_user’, ’mysql_password’);
if (!$link) {
die(’Could not connect: ’ . mysql_error());
}
$result = mysql_query(’SELECT name FROM work.employee’);
if (!$result) {
die(’Could not query:’ . mysql_error());
}
echo mysql_result($result, 2); // outputs third employee’s name
mysql_close($link);
?>[/tt]
There should be an equivalent in the Modx API.
A thing of beauty is a joy forever ( John Keats)
-
☆ A M B ☆
- 24,524 Posts
No, but it won’t hurt to use that php function on the result set from a modx API select.
Thanks sotwell. You are really sweet. You’ve guided me a number of times. I appreciate all the effort.
-Raavi