New favorite color

[(silent
   ; Try to UPDATE.  If zero rows updated, try INSERT.
   (begin
     (if (zero? (brl-sql "update brlewis.my_color"
                         "  set color = " (brl-sql-string newcolor)
                         "  where uname = USER"))
         (brl-sql "insert into brlewis.my_color
                   VALUES(USER, " (brl-sql-string newcolor) ")"))

     (brl-sql "commit")))]

Your favorite color is now [(html newcolor)]!

By the way, did you know that [newcolor] spelled backwards is [(list->string (reverse (string->list newcolor)))]?


Bruce Lewis <brlewis@mit.edu>
Last modified: Fri May 9 16:39:16 EDT 1997