Hi guys, you have answered many of my queries in the past so thanks on that, but i need help on this.
i have a simple form on a page passing a score, level and playername
the code below is on a page that should write to a db. i have done this before on my own site and have compared this code with other code and it looks fine, however, i keep getting a syntax error in INSERT INTO statement. I have played with things and taken the numbers out and it seeems to be ok just insert the playername field. so prob something to with the numbers?
any ideas?
<%
level = Trim(request("level"))
score = Trim(request("score"))
playername = Trim(request("playername"))
Dim objConn
Dim strConnectionString
strConnectionString = MM_fr_record_webtest_STRING
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.open strConnectionString
sqlstring = "INSERT INTO highscores ( level, score, playername ) " &_
"VALUES (" & Replace(level, "'", "''") & "," & Replace(score, "'", "''") & ",'" & Replace(playername, "'", "''") & "')"
objConn.Execute (sqlString)
%>
Cheers
Mark
Edited by ainsworth14