[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.&nbsp; I am not able to run an insert into my mysql=20
database.&nbsp; I can run a test on the connection object, it works just =
fine so=20
I assume the db connection/operation is OK.&nbsp; 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.&nbsp; I have tried to use separate input forms and processing =

pages.&nbsp; I can see my variables passed to the new page.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>It seems that the sqlvar is not =
allowing the passed=20
data to go through.&nbsp; I have tried 'type=3D"string"' as well.&nbsp; =
I am just=20
plain lost with this now and I need help!&nbsp; 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>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Any help is appreciated!&nbsp; =
</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Greg</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</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
(&lt;dtml-sqlvar username type=3D"nb" &gt;,&lt;dtml-sqlvar rtype=20
type=3D"nb"&gt;<BR>,&lt;dtml-sqlvar req type=3D"nb"&gt;)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</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>&nbsp;</DIV>
<DIV>DTML Method------------------------------frmInsertRequest</DIV>
<DIV>&lt;dtml-var standard_html_header&gt;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&lt;dtml-if submit&gt;<BR></DIV>
<DIV>&lt;dtml-call sqlInsertRequest&gt;<BR></DIV>
<DIV>&lt;h2&gt;Added&lt;/h2&gt;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&lt;dtml-else&gt;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&lt;h2&gt;&lt;dtml-var title_or_id&gt; &lt;dtml-var=20
document_title&gt;&lt;/h2&gt;<BR>&lt;p&gt;<BR>&lt;form =
action=3D"frmInsertRequest"=20
method=3D"post"&gt;<BR>&lt;table&gt;<BR>&lt;tr&gt;&lt;td&gt;Username:&lt;=
/td&gt;=20
&lt;td&gt;<BR>&lt;input type=3Dtext size=3D20 name=3D"username" =
value=3D""=20
&gt;<BR>&lt;/td&gt;&lt;/tr&gt;<BR>&lt;tr&gt;&lt;td&gt;Type:&lt;/td&gt;&lt=
;td&gt;<BR>&lt;input=20
type=3Dtext size=3D20 name=3D"rtype"=20
value=3D""&gt;<BR>&lt;/td&gt;&lt;/tr&gt;<BR>&lt;tr&gt;&lt;td&gt;Request:&=
lt;/td&gt;&lt;td&gt;<BR>&lt;input=20
type=3Dtext size=3D20 name=3D"req"=20
value=3D""&gt;<BR>&lt;/td&gt;&lt;/tr&gt;<BR>&lt;/table&gt;<BR>&lt;input=20
type=3D"submit" name=3D"submit"=20
value=3D"submit"&gt;<BR>&lt;/form&gt;<BR>&lt;/p&gt;<BR>&lt;/dtml-if&gt;<B=
R>&lt;dtml-var=20
standard_html_footer&gt;<BR>---------------------------------------------=
-----------------------------</DIV></FONT>
<DIV><FONT face=3DArial size=3D2>This is resulting page:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</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: &lt;string&gt;)
  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--