[Zope-DB] cant perform insert on mysql
Greg
Greg" <beavis@comwww.net
Mon, 27 May 2002 02:47:06 -0700
This is a multi-part message in MIME format.
------=_NextPart_000_001F_01C20528.C9ACC910
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
I am guessing someone has seen this or at least has some info for me. I =
am not able to run an insert into my mysql database. I can run a test =
on the connection object, it works just fine so I assume the db =
connection/operation is OK. But in my Zsql method the insert does not =
work.
Below are my forms used and the resulting page with the error. I have =
tried to use separate input forms and processing pages. I can see my =
variables passed to the new page.
It seems that the sqlvar is not allowing the passed data to go through. =
I have tried 'type=3D"string"' as well. I am just plain lost with this =
now and I need help! I really want to move my web sites out of IIS and =
into Zope(on Linux), I can see it has great potential and time saving =
features for developers, but if I cant insert into a database, I am =
screwed!
Any help is appreciated! =20
Greg
ZSQL Method------------------------sqlInsertRequest
insert into Requests (username,rtype,req)
values (<dtml-sqlvar username type=3D"nb" >,<dtml-sqlvar rtype =
type=3D"nb">
,<dtml-sqlvar req type=3D"nb">)
--------------------------------------------------------------------
and the form I use to call the method:
DTML Method------------------------------frmInsertRequest
<dtml-var standard_html_header>
<dtml-if submit>
<dtml-call sqlInsertRequest>
<h2>Added</h2>
<dtml-else>
<h2><dtml-var title_or_id> <dtml-var document_title></h2>
<p>
<form action=3D"frmInsertRequest" method=3D"post">
<table>
<tr><td>Username:</td> <td>
<input type=3Dtext size=3D20 name=3D"username" value=3D"" >
</td></tr>
<tr><td>Type:</td><td>
<input type=3Dtext size=3D20 name=3D"rtype" value=3D"">
</td></tr>
<tr><td>Request:</td><td>
<input type=3Dtext size=3D20 name=3D"req" value=3D"">
</td></tr>
</table>
<input type=3D"submit" name=3D"submit" value=3D"submit">
</form>
</p>
</dtml-if>
<dtml-var standard_html_footer>
-------------------------------------------------------------------------=
-
This is resulting page:
Missing input variable, username=20
Traceback (innermost last):
File /usr/local/Zope/lib/python/ZPublisher/Publish.py, line 150, in =
publish_module
File /usr/local/Zope/lib/python/ZPublisher/Publish.py, line 114, in =
publish
File /usr/local/Zope/lib/python/Zope/__init__.py, line 159, in =
zpublisher_exception_hook
(Object: Helpdesk)
File /usr/local/Zope/lib/python/ZPublisher/Publish.py, line 98, in =
publish
File /usr/local/Zope/lib/python/ZPublisher/mapply.py, line 88, in =
mapply
(Object: frmInsertRequest)
File /usr/local/Zope/lib/python/ZPublisher/Publish.py, line 39, in =
call_object
(Object: frmInsertRequest)
File /usr/local/Zope/lib/python/OFS/DTMLMethod.py, line 127, in =
__call__
(Object: frmInsertRequest)
File /usr/local/Zope/lib/python/DocumentTemplate/DT_String.py, line =
473, in __call__
(Object: frmInsertRequest)
File /usr/local/Zope/lib/python/Shared/DC/ZRDB/DA.py, line 414, in =
__call__
(Object: sqlInsertRequest)
File /usr/local/Zope/lib/python/DocumentTemplate/DT_String.py, line =
473, in __call__
(Object: <string>)
File /usr/local/Zope/lib/python/Shared/DC/ZRDB/sqlvar.py, line 99, in =
render
(Object: username)
Missing Input: (see above)
------=_NextPart_000_001F_01C20528.C9ACC910
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2712.300" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#fffefe>
<DIV><FONT face=3DArial size=3D2>I am guessing someone has seen this or =
at least has=20
some info for me. I am not able to run an insert into my mysql=20
database. I can run a test on the connection object, it works just =
fine so=20
I assume the db connection/operation is OK. But in my Zsql method =
the=20
insert does not work.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Below are my forms used and the =
resulting page with=20
the error. I have tried to use separate input forms and processing =
pages. I can see my variables passed to the new page.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>It seems that the sqlvar is not =
allowing the passed=20
data to go through. I have tried 'type=3D"string"' as well. =
I am just=20
plain lost with this now and I need help! I really want to move my =
web=20
sites out of IIS and into Zope(on Linux), I can see it has great =
potential and=20
time saving features for developers, but if I cant insert into a =
database, I am=20
screwed!</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Any help is appreciated! =
</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Greg</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>ZSQL=20
Method------------------------sqlInsertRequest</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>insert into Requests =
(username,rtype,req)<BR>values=20
(<dtml-sqlvar username type=3D"nb" >,<dtml-sqlvar rtype=20
type=3D"nb"><BR>,<dtml-sqlvar req type=3D"nb">)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial=20
size=3D2>----------------------------------------------------------------=
----</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>and the form I use to call the =
method:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> </DIV>
<DIV>DTML Method------------------------------frmInsertRequest</DIV>
<DIV><dtml-var standard_html_header></DIV>
<DIV> </DIV>
<DIV><dtml-if submit><BR></DIV>
<DIV><dtml-call sqlInsertRequest><BR></DIV>
<DIV><h2>Added</h2></DIV>
<DIV> </DIV>
<DIV><dtml-else></DIV>
<DIV> </DIV>
<DIV><h2><dtml-var title_or_id> <dtml-var=20
document_title></h2><BR><p><BR><form =
action=3D"frmInsertRequest"=20
method=3D"post"><BR><table><BR><tr><td>Username:<=
/td>=20
<td><BR><input type=3Dtext size=3D20 name=3D"username" =
value=3D""=20
><BR></td></tr><BR><tr><td>Type:</td><=
;td><BR><input=20
type=3Dtext size=3D20 name=3D"rtype"=20
value=3D""><BR></td></tr><BR><tr><td>Request:&=
lt;/td><td><BR><input=20
type=3Dtext size=3D20 name=3D"req"=20
value=3D""><BR></td></tr><BR></table><BR><input=20
type=3D"submit" name=3D"submit"=20
value=3D"submit"><BR></form><BR></p><BR></dtml-if><B=
R><dtml-var=20
standard_html_footer><BR>---------------------------------------------=
-----------------------------</DIV></FONT>
<DIV><FONT face=3DArial size=3D2>This is resulting page:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV>Missing input variable, <EM>username</EM>=20
<P><A href=3D"http://www.zope.org/Credits" =
target=3D_top></A></P><PRE>Traceback (innermost last):
File /usr/local/Zope/lib/python/ZPublisher/Publish.py, line 150, in =
publish_module
File /usr/local/Zope/lib/python/ZPublisher/Publish.py, line 114, in =
publish
File /usr/local/Zope/lib/python/Zope/__init__.py, line 159, in =
zpublisher_exception_hook
(Object: Helpdesk)
File /usr/local/Zope/lib/python/ZPublisher/Publish.py, line 98, in =
publish
File /usr/local/Zope/lib/python/ZPublisher/mapply.py, line 88, in =
mapply
(Object: frmInsertRequest)
File /usr/local/Zope/lib/python/ZPublisher/Publish.py, line 39, in =
call_object
(Object: frmInsertRequest)
File /usr/local/Zope/lib/python/OFS/DTMLMethod.py, line 127, in =
__call__
(Object: frmInsertRequest)
File /usr/local/Zope/lib/python/DocumentTemplate/DT_String.py, line =
473, in __call__
(Object: frmInsertRequest)
File /usr/local/Zope/lib/python/Shared/DC/ZRDB/DA.py, line 414, in =
__call__
(Object: sqlInsertRequest)
File /usr/local/Zope/lib/python/DocumentTemplate/DT_String.py, line =
473, in __call__
(Object: <string>)
File /usr/local/Zope/lib/python/Shared/DC/ZRDB/sqlvar.py, line 99, in =
render
(Object: username)
Missing Input: (see above)
</PRE></DIV></BODY></HTML>
------=_NextPart_000_001F_01C20528.C9ACC910--