[thelist] mysql help
Mark Mckee
lists at soddengecko.com
Sun Oct 1 19:18:08 CDT 2006
hi
how can i thank you enough. iw as toying with the idea of having a
second sql statement but had no idea how to implement it
thank you very much for your help
kind regards
mark m...
der wert wrote:
> This should help you in getting started
>
> $sql = 'SELECT DISTINCT category FROM info ORDER BY category;';
> $result = mysql_query($sql) or die('There are currently no links in
> the database.');
>
> while ($row = mysql_fetch_assoc($result)){
> echo '<div class="left"><h1>'.$row['category'].'</h1><ul>';
>
> $sql2 = 'SELECT * FROM info WHERE category="'.$row['category'].'"
> ORDER BY title;';
> $result2 = mysql_query($sql2);
>
> while ($row2 = mysql_fetch_assoc($result2)){
> echo '<li><a href="'.$row2['url'].'"
> target="_blank">'.$row2['title'].'</a></li>';
> }
> echo '</ul></div>';
> }
>
> _________________________________________________________________
> The next generation of Search—say hello!
> http://imagine-windowslive.com/minisites/searchlaunch/?locale=en-us&FORM=WLMTAG
>
>
More information about the thelist
mailing list