Yes, the "to" attribute of the getColumn tag writes to a Servlet attribute, not a scripting variable. A scripting variable would have been awkward because the "to" attribute is optional; by default the tag will simply write to the current writer.
----- Original Message ----- From: "Carole E. Mah" <[EMAIL PROTECTED]> To: "Tag Libraries Users List" <[EMAIL PROTECTED]> Sent: Tuesday, April 23, 2002 1:35 PM Subject: getColumn > > I don't understand how to use the "to" attribute. > > <% > String myValue = request.getParameter("bar"); > %> > > <sql:getColumn colName="blort" to="myValue"> > > This is the sort of thing I want to do, I think. But it does not work, > i.e. the string "foo" has a value "bar" and that ought to get written over > by the value of colName "blort" but it does not. > > Basically what I want is to get each row value of the 'blort' column from > my "blah" DBtable, and write that to an <option> value. > > In PHP, this would be: > $query = "SELECT farble, blort FROM blah"; > $my_result = mysql_db_query ($dbname, $query, $linkid); > echo "<select name=\"whatever\">"; > while ($my_row =mysql_fetch_object($my_result)) { > $myValue = $my_row->blort; > echo "<option value=\"$myValue\">$myValue</option> > } > echo "</select>"; > > Clearly "to" writes somewhere other than a scriplet variable. > > ?? I am not very smart today. > > Thanks for any advice, > -Carole > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > Carole E. Mah [EMAIL PROTECTED] > Senior Programmer/Analyst > Brown University Scholarly Technology Group > phn 401-863-2669 > fax 401-863-9313 > http://www.stg.brown.edu/ > personal: http://www.stg.brown.edu/~carolem/ > > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>