
April 8th, 2008, 03:21 AM
|
|
Registered User
|
|
Join Date: Apr 2008
Posts: 4
Time spent in forums: 1 h 4 m 4 sec
Reputation Power: 0
|
|
|
Multiple field update problem
hi there im havin a problem im trying to update multiple fields in one record but it is givin me som problems i cant find
first off this is my code for the page making the sql statement.
Code:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="component/DB_connections.asp" -->
<%
a1 = session("typeids")
a2 = session("typeshipname1")
a3 = session("highnamefield")
a4 = session("highslotfield")
a5 = session("shipconname")
g = request.QueryString("marketgn")
x = request.QueryString("gfxid")
%>
<%
set getmgroup=Server.CreateObject("ADODB.RecordSet")
sql="SELECT * FROM evegraphics WHERE graphicID = '"&x&"'"
set getmgroup = triconn.Execute(sql)
gfxindid = getmgroup.fields.item("icon").value
Function ReplaceQuotes(strValue)
strValue = Replace(strValue, "'", "")
ReplaceQuotes = strValue
End Function
a9 = ReplaceQuotes(g)
<!--- this generates the sql statement --->
IF request.Form("highname2") = "no" THEN hend1 = "" ELSE hend1 = "," END IF
IF request.Form("highname3") = "no" THEN hend2 = "" ELSE hend2 = "," END IF
IF request.Form("highname4") = "no" THEN hend3 = "" ELSE hend3 = "," END IF
IF request.Form("highname5") = "no" THEN hend4 = "" ELSE hend4 = "," END IF
IF request.Form("highname6") = "no" THEN hend5 = "" ELSE hend5 = "," END IF
IF request.Form("highname7") = "no" THEN hend6 = "" ELSE hend6 = "," END IF
IF request.Form("highname8") = "no" THEN hend7 = "" ELSE hend7 = "," END IF
IF request.Form("midname1") = "no" THEN mend8 = "" ELSE mend8 = "," END IF
IF request.Form("midname2") = "no" THEN mend1 = "" ELSE mend1 = "," END IF
IF request.Form("midname3") = "no" THEN mend2 = "" ELSE mend2 = "," END IF
IF request.Form("midname4") = "no" THEN mend3 = "" ELSE mend3 = "," END IF
IF request.Form("midname5") = "no" THEN mend4 = "" ELSE mend4 = "," END IF
IF request.Form("midname6") = "no" THEN mend5 = "" ELSE mend5 = "," END IF
IF request.Form("midname7") = "no" THEN mend6 = "" ELSE mend6 = "," END IF
IF request.Form("midname8") = "no" THEN mend7 = "" ELSE mend7 = "," END IF
setsql = "UPDATE loadout SET "
IF request.Form("highname1") = "yes" Then setsql = setsql & " highname1 = '"&a9&"', highslotgfxid1 = "&gfxindid&"" & hend1 END IF
IF request.Form("highname2") = "yes" Then setsql = setsql & " highname2 = '"&a9&"', highslotgfxid2 = "&gfxindid&"" & hend2 END IF
IF request.Form("highname3") = "yes" Then setsql = setsql & " highname3 = '"&a9&"', highslotgfxid3 = "&gfxindid&"" & hend3 END IF
IF request.Form("highname4") = "yes" Then setsql = setsql & " highname4 = '"&a9&"', highslotgfxid4 = "&gfxindid&"" & hend4 END IF
IF request.Form("highname5") = "yes" Then setsql = setsql & " highname5 = '"&a9&"', highslotgfxid5 = "&gfxindid&"" & hend5 END IF
IF request.Form("highname6") = "yes" Then setsql = setsql & " highname6 = '"&a9&"', highslotgfxid6 = "&gfxindid&"" & hend6 END IF
IF request.Form("highname7") = "yes" Then setsql = setsql & " highname7 = '"&a9&"', highslotgfxid7 = "&gfxindid&"" & hend7 END IF
IF request.Form("highname8") = "yes" Then setsql = setsql & " highname8 = '"&a9&"', highslotgfxid8 = "&gfxindid&"" & mend8 END IF
<!--- generation complete --->
sql4=""&setsql&" WHERE shipconname = '"&a5&"' AND typeid = "&a1&""
response.Write sql4
response.end
triconn.Execute(sql4)
response.Redirect("test4.asp?type="&a1&"&shipn="&a5&"")
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = -1
Repeat1__index = 0
getmgroup_numRows = getmgroup_numRows + Repeat1__numRows
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Ship Selection</title>
<style type="text/css" media="screen">
A:LINK { color:white; text-decoration:none;}
A:VISITED { color:White; text-decoration:none;}
A:ACTIVE { color:white; text-decoration:none;}
A:HOVER { Color:red; }
</style>
</head>
<body style="margin:0; padding:0; font-family:Verdana, Arial, Helvetica, sans-serif;" bgcolor="#747373" text="#FFFFFF">
<table border="0" cellpadding="0" cellspacing="0" width="580" height="479" bgcolor="#747373" align="center">
<tr>
<td style="background:url(../img/cont.png); background-repeat:no-repeat; background-position:center;">
<div style=" width:465px; height:408px; overflow:scroll; margin-top:30px; margin-left:50px; color:White; padding-left:10px;">
<br />
<ul>
<%
While ((Repeat1__numRows <> 0) AND (NOT getmgroup.EOF))
%>
<li><a href="itemselect.asp?marketg=<%=getmgroup.fields.item("marketgroupid").value%>&check=1"><%=getmgroup.fields.item("marketgroupname").value%></a></li>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
getmgroup.MoveNext()
Wend
%>
</ul>
</div>
</td>
</tr>
</table>
</body>
</html>
Then this is the error code i get in the browser when running it.
Code:
Errortype:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[MySQL][ODBC 5.1 Driver][mysqld-5.0.51a-community-nt]Unknown column '13_15' in 'field list'
/bsc/ind_item.asp, line 57
and this is the debug line of the sql stement with fillings :
Code:
UPDATE loadout SET highname1 = 'Mega Pulse Laser II', highslotgfxid1 = 13_15, highname2 = 'Mega Pulse Laser II', highslotgfxid2 = 13_15, highname3 = 'Mega Pulse Laser II', highslotgfxid3 = 13_15, highname4 = 'Mega Pulse Laser II', highslotgfxid4 = 13_15, highname5 = 'Mega Pulse Laser II', highslotgfxid5 = 13_15, highname6 = 'Mega Pulse Laser II', highslotgfxid6 = 13_15 WHERE shipconname = 'aramged1' AND typeid = 643
if any have some idea what is wrong with my statement pls tel me course i cant seam to figure this out  i cchecked the colums in the db and ther name is corroct in the statement hence why im confused
Jens
thx in advanced
|