You can achieve using LIMIT option with the select stmt. Regards, Joseph
>-----Original Message----- >From: Andrew Maynes [mailto:[EMAIL PROTECTED]] >Sent: Wednesday, February 05, 2003 11:22 PM >To: MySQL-Lista >Subject: query produces a navigation > > >I have a set of records in a mysql table that are called >categories. A query pulls all the records for category and in >turn this are then <links> to items of that said category. >Simple. Ok here is the bit I want some feeback on. I want to >create another table (if this is the solution) and split the >category into groups, this is for the purpose of navigation. >So istead of having 30 categories I will have X number of >goups with categories in X group. > >Do I need to create another table to do this (as we did with >the ref_colour) or can I split the output in a simple way with >creating a table. I guess that some form of id is needed to >seperate the records? > >This is what I have: > >$result=mysql("$DBName","SELECT * FROM Category ORDER BY >Category"); fontFace("Arial","Select a category:<br><br>"); >echo "<ul>"; while ($row = mysql_fetch_row($result)) { >$Cat=$row[0]; $CatID=$row[1]; echo"<li><a >href='$Relative/items.php?CA=$CatID&UID=$UID'>$Cat</a></li>"; > } >echo "</ul>"; > >Andrew > > >--------------------------------------------------------------------- >Before posting, please check: > http://www.mysql.com/manual.php (the manual) > http://lists.mysql.com/ (the list archive) > >To request this thread, e-mail <[EMAIL PROTECTED]> >To unsubscribe, e-mail ><[EMAIL PROTECTED]> >Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php > > --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php