[thelist] On Dowdell; Tip with Alphabet Nav (was: RE: Curl)

Joe Crawford joe at artlung.com
Wed Aug 8 14:57:53 CDT 2001


John Dowdell wrote:
> At 7:21 PM 8/7/1, Joe Crawford wrote:
> > Anyone with an alternative take?
>
> That aside, if studying Curl gives you ideas for things you'd like to
> accomplish in your own work, then such requests sent to wish-flash or
> wish-director at macromedia.com can help to guide future engineering,
thanks.
>
> (Rephrased, even if the business model is not resolved, they may come up
> with interesting ideas for new types of web applications. If you see
> something that spurs your imagination, then that would be a good request
> for the two widely-deployed clientside interactivity engines.)

Whatever they pay you, Dowdell, it's not enough. You're a consistently
smart, engaging, and talented evangelist for your company. Been watching
you for what seems like eons on this list, on usenet, in the
forums.macromedia.com groups, on flasher-L, and you just rock. Anyone
doing evangalism for a company could do no better than look at how you
comport yourself and frame your arguments. Kudos. I ain't sucking up, I
swear.

I probably should tip for this...

<tip type="alphabetical interfaces, Cold Fusion/SQLServer and PHP4/MySQL">
I've been playing with lots of data lately, and lastnames in particular
lend themselves to a navigation A-Z. PROBLEM: Usually Z ain't got nothing,
but it's got a link anyway. Links with no data behind them are
time-wasters for users - so why not build the nav on the fly?

So here's my php/mysql sample:
<?
$addr_table="contact_list"
$nav_column="last_name"
$query = "select
	distinct LEFT($nav_column,1) as ALPHA
	from      $addr_table
	order by ALPHA";
/* you will need your own connection function here
   mine is called connectToDatabase() */
connectToDatabase() or die ("Cannot connect to server.");
$result=mysql_query( $query ) or die ("Cannot make query.");
while ($row = mysql_fetch_array ($result)) {
	extract($row);
	echo "<a href='show.php?startletter=$ALPHA'>$ALPHA</a>|";
};
?>
And here it is in CF:
<!-- *********************************************** -->
<cfset addr_table="contact_list">
<cfset nav_column="last_name">
<!--- you'll need a DSN_NAME below --->
<cfquery name="nav" datasource="#DSN_NAME#" dbtype="ODBC">
select
	distinct LEFT(#nav_column#,1) as ALPHA
	from      #addr_table#
	order by ALPHA
</cfquery>
<cfoutput query="nav">
| <A HREF='show.cfm?startletter=#ALPHA#'>#ALPHA#</a>
</cfoutput>
<!-- *********************************************** -->

I think that's ready-to-rock code. If you try it and it breaks, hit me
with a note.

</tip>

Have a great day,

	-Joe

--
...........  Joe Crawford : thinking and design about the web
.... enigmatic narcissism and miscellany : http://artlung.com
.... community instigator : http://WebSanDiego.org
.... San Diego, California, USA .....................AAAFNRAA





More information about the thelist mailing list