Welcome to WebmasterWorld Guest from 107.21.183.163

Forum Moderators: open

Message Too Old, No Replies

Skipping a row, whilst sorting a table

     

londrum

8:53 am on Jul 31, 2010 (gmt 0)

WebmasterWorld Senior Member 5+ Year Member



i'm guessing that this is probably impossible, but im hoping someone brainy knows how to do it...

i've got a page which displays a table of data, which is sorted by date. so far, so easy.

but when it comes to two rows in particular, i need them to appear as if they were the next row down. so when the script prints all the rows out, i need to skip over them for just one row, and print them after the next one.

is that possible?

rocknbil

4:28 pm on Jul 31, 2010 (gmt 0)

WebmasterWorld Senior Member rocknbil is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Me gotz nuttin' . . . in mySQL anyway.

What are the "identifying factors" of these rows? Are they a series of conditions you can pick up via programmimg without hard coding them?

LifeinAsia

3:45 pm on Aug 2, 2010 (gmt 0)

WebmasterWorld Administrator lifeinasia is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month



Can you provide some example data? Will it always be those 2 rows, or rows meeting certain conditions?

londrum

5:19 pm on Aug 2, 2010 (gmt 0)

WebmasterWorld Senior Member 5+ Year Member



i think i've resigned myself to adding a new column.
but this is what the problem is...

it's a database of songs. and i can sort them alphabetically and by release date, because they're the only columns i've got.

when i sort them by release date, and two songs share the same date (because they are the A and B-side of a single) i naturally want to list the A-side first. but at the moment i can only list them alphabtically, which is wrong about 50% of the time.

so i was hoping i could get it to skip a row every time a certain song title came up.

LifeinAsia

5:41 pm on Aug 2, 2010 (gmt 0)

WebmasterWorld Administrator lifeinasia is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month



Yes, I would add another field and do a secondary ORDER on that field.

enigma1

3:30 pm on Aug 14, 2010 (gmt 0)

WebmasterWorld Senior Member 5+ Year Member



or you could expand the date col to be datetime and then set the secs for instance to force ordering without an additional col.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month