Hint:mysql::query(dbh, SQL)
In your example you assign the variable SQL with the statement but that's it.
Now MySQL needs to process it with the query() function.
Nothing to fetch() as your not requesting a return of any data.
If the row already exists and has a unique 'key' (index) then you would get an error on the INSERT and would have to use a UPDATE instead.
You have an error in your SQL string as well.
SQL = "INSERT INTO contact (NAME) VALUES (" & TEXT-FIELD")"
should be:
SQL = "INSERT INTO contact (NAME) VALUES ('" & cgi::PostParam("TEXT-FIELD") & "')"
John