Hi i have been developing a tutorial system for a while now and have gotten pretty much everything done but this. I want the top 10 overall rated tutorials to be displayed in the html form below. I was thinking of using the while() loop but then saw that it would not work since their i cant use it and have to <td></td>s in the same <tr> which is being looped. Any thoughts? the score is determined by a field in my table called score and i was thinking of using a query that orders by score.
Thanks

As this loops, the start/end tr are only used if the count field/2 has no remainder which happens every other record, may require some slight corrections to get it to display correctly but you should get the general idea.

Hope this helps.

LoRd_aLmIghTy

12-26-2006, 05:17 PM

yes i understand that but thats just displaying them in a list sort of. i wanted them to be 2 apiece in side one <tr> and the places where their is no data to display no entrie in that <td>. if you dont understand look at he html table i posted in my earlier post. hope this helps clear confusion.

...and anarchy3200 wasnt confused...he was correct in the code he knocked up and should have provided a bit of clarity in how to make the code your asking for. His code simply displays the "<td>What ever</td>" twice, then places a "</tr><tr>" which what your aking for. You could have edited the echo "<td>What ever</td>" to display what ever you want....

LoRd_aLmIghTy

12-26-2006, 05:42 PM

thanks daniel thats pretty much what i meant except for the no data thing. i meant for each <td> with no data i wanted it to have a thumb of my choosing and text saying no entrie. so basicly if i only had 2 tutorials the top <tr> would have them and the bottom 4 <tr>'s would have each <td> saying no content. can you show me that code please.

thanks

anarchy3200

12-26-2006, 06:37 PM

Hi, sorry about before, i did try to update my post and add another reply but my internet kept dropping out...
As to the alternate text if an entry doesn't exist try replacing the lines:

With this if there is a value of anysort returned from the query then the first echo will run and the value will be displayed, if there is not anything returned from the query the second set of echo's are shows displaying that there is no content.

LoRd_aLmIghTy

12-26-2006, 07:41 PM

thanks for that thats 50% of what i was asking. the other part is lets say i have 3 tutorials and i set my query in that script to limit 6 i want the 3 to b displayed which they do and the right <td> next to the third goes to no content which i want. but i also want the remaining last 2 <tr>s to display No content in their <td>'s as well.