I have the following code to work out the difference between two fields on successive rows, and this works fine.
On another page I'm using the following code to select every 24th row in the table.PHP Code:$query6="
SELECT t1.id AS id1, t2.id AS id2,
t1.overallr AS overallr1, t2.overallr AS overallr2,
t2.overallr-t1.overallr AS dist
FROM {$table} AS t1, {$table} AS t2
WHERE t1.id+1 = t2.id
ORDER BY t1.id;
";
But for some reason I can't combine the two concepts. I want to "execute" the first bit of code on every 24th row, instead of all of them.PHP Code:$query7="SELECT * FROM {$table} WHERE id = '1' or id % 24 = 0";
Thank you in advance- I hope you can help.



Reply With Quote

Bookmarks