Re: putting db results in a 5 x 1 table



Eddie Biscomb wrote:
I have a db of tens of thousands of entries. It's not too hard to pull all the entries and build a table that displays them one at a time, but in my case, that will be a huge waste of space. What I want to do is put one record in each of the columns. I thinks it's possible to do because I have seen very elaborate thumbnail gallery scripts to do this. I just want to be able to put two or three strings of text from each record into each row, and a checkbox. Here's sample of what I mean:

<table width="76%"  border="1" cellspacing="1" cellpadding="1">
  <tr>
    <td>$record1Line1<br>$record1$Line2<br>
<input type="checkbox" name="$record1checkbox" value="checkbox"></td>
    <td>$record2Line1<br>$record2$Line2<br>
<input type="checkbox" name="$record2checkbox" value="checkbox"></td>
    <td>$record3Line1<br>$record3$Line2<br>
<input type="checkbox" name="$record3checkbox" value="checkbox"></td>
    <td>$record4Line1<br>$record4$Line2<br>
<input type="checkbox" name="$record3checkbox" value="checkbox"></td>
    <td>$record5Line1<br>$record5$Line2<br>
<input type="checkbox" name="$record5checkbox" value="checkbox"></td>
  </tr>
</table>

I want to pull about 200 records at a time from the db and display as described above. How can I tell php to take five records from my result set and display above, then loop through the result set until I'm done?

Thanks much for any guidance you can offer.

Ed
I think you are after the LIMIT clause.
Select * from db where blabla LIMIT 5
See MySQL manual for complete coverage of LIMIT usage.

SH
.



Relevant Pages

  • Re: Windows Mail (Vista) taking a long time to display Contacts when sending email
    ... He has not added/deleted any entries since the last time that it ... opened - If he opens the contacts list explicitly from the Windows ... but 10 seconds to display the list when it's ... exporting them as nothing will change with a simple move though it might ...
    (uk.comp.misc)
  • Re: Windows Mail (Vista) taking a long time to display Contacts when sending email
    ... He has not added/deleted any entries since the last time that it ... worked properly - ie the entries appeared as soon as the window opened ... Tried moving all the .CONTACT files out of the normal folder. ... it took progressively longer to display them. ...
    (uk.comp.misc)
  • Re: How to do this (listbox control)
    ... so I can display the contents of a std::map (or in VB ... I want to use a users selection in one combobox, to 'filter' the ... characters - all other entries will be removed. ...
    (microsoft.public.vb.general.discussion)
  • Re: How to open call log form through code??
    ... to filter by Incoming, Outgoing or Missed calls. ... Did you get any API to display the call logs as it is in WM 5.0 default ... display those entries as they are shown by the WM 5.0 default behaviour. ...
    (microsoft.public.pocketpc.developer)
  • Re: My Computer change...
    ... Groups" option does properly alphabetize the entries, ... Local Disk | Local Disk " etc. ... >" etc. I'm looking to return the display to the way ... identifies the entries ...
    (microsoft.public.windowsxp.general)