[Zope-DB] cant perform insert on mysql

Antonio Orlando aorlando2002@yahoo.com.br
Mon, 27 May 2002 09:21:48 -0400


Greg,

I'm not sure, but have you look at your parameter ZSQL? did you have 
declared "username" there? did you have "filled" the form? I know you 
are not passing the values to the ZSQL - you are passing them to the 
"frminsert", you need to pass them to the ZSQL. something like: 
zsqlmethod_insert_something(username=username,etc=etc)

hope this helps


anTONIo


Greg wrote:

> 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="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! 
> 
> Greg
> 
>  
> 
>  
> 
> ZSQL Method------------------------sqlInsertRequest
> 
> insert into Requests (username,rtype,req)
> values (<dtml-sqlvar username type="nb" >,<dtml-sqlvar rtype type="nb">
> ,<dtml-sqlvar req type="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="frmInsertRequest" method="post">
> <table>
> <tr><td>Username:</td> <td>
> <input type=text size=20 name="username" value="" >
> </td></tr>
> <tr><td>Type:</td><td>
> <input type=text size=20 name="rtype" value="">
> </td></tr>
> <tr><td>Request:</td><td>
> <input type=text size=20 name="req" value="">
> </td></tr>
> </table>
> <input type="submit" name="submit" value="submit">
> </form>
> </p>
> </dtml-if>
> <dtml-var standard_html_footer>
> --------------------------------------------------------------------------
> 
> This is resulting page:
> 
>  
> 
> Missing input variable, username
> 
> <http://www.zope.org/Credits>
> 
> 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)
> 



_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com