stinkysGTI
08-22-2007, 04:57 PM
I'm very new to asp/ms sql structure. i come from a php/mysql world :)
So here's my problem
I'm trying to insert data into a database using the following code:
g_strQuery = "UPDATE [stories] SET "
g_strQuery &= "headline='" & SQL_Format( Form_Value( "headline" ) ) & "'" & "," & " "
g_strQuery &= "copy='" & SQL_Format( Form_Value( "copy" ) ) & "'" & "," & " "
g_strQuery &= "link='" & SQL_Format( Form_Value( "link" ) ) & "'" & "," & " "
g_strQuery &= "excerpt='" & SQL_Format( Form_Value( "excerpt" ) ) & "'" & "," & " "
g_strQuery &= "WHERE ( StoryID='" & strID & "' );"
All it's doing is adding a new row into the DB, but every column (except auto-inc ID) is NULL and I get this error:
Incorrect syntax near the keyword 'WHERE'.
It looks fine to me though. Am I just missing some little thing here??
thank you for any help you may have
So here's my problem
I'm trying to insert data into a database using the following code:
g_strQuery = "UPDATE [stories] SET "
g_strQuery &= "headline='" & SQL_Format( Form_Value( "headline" ) ) & "'" & "," & " "
g_strQuery &= "copy='" & SQL_Format( Form_Value( "copy" ) ) & "'" & "," & " "
g_strQuery &= "link='" & SQL_Format( Form_Value( "link" ) ) & "'" & "," & " "
g_strQuery &= "excerpt='" & SQL_Format( Form_Value( "excerpt" ) ) & "'" & "," & " "
g_strQuery &= "WHERE ( StoryID='" & strID & "' );"
All it's doing is adding a new row into the DB, but every column (except auto-inc ID) is NULL and I get this error:
Incorrect syntax near the keyword 'WHERE'.
It looks fine to me though. Am I just missing some little thing here??
thank you for any help you may have