flyingboabab, at first glance, it appears that your problem is with your sql-query, and not so much the rest of the code. Rather try something like the following: set text [mysqlescape $text] set sql "REPLACE DELAYED prices SET price='$text' WHERE city ='NY' " I hope this helps. FossilAtrum