[Zope] In desparate need of some help

jpenny@universal-fasteners.com jpenny@universal-fasteners.com
Tue, 16 Jan 2001 18:55:55 -0500


On Tue, Jan 16, 2001 at 11:40:21PM -0000, alankirk wrote:
>   Hi there, i am new to zope and i'm in need of some help. I'm using zope as part of my final year project for university. I am using zope with a database i've constructed using MySQL. I've been having trouble sending queries to MySQL for data from the tables in the DB, instead of the required data i get an error message window appear and my python server crashes(which is running on my machine, by the way i'm using version 2.2.2 of zope on windows ME). Somethimes the error message is blank, other times it's PYTHON15.DLL or MYSQL.DLL when it crashes. Also when i submit a query to add data to a table zope returns what appears to be a error message in my browser, which the zope control panel is using, but the data is still added to my DB table.
> When submitting a query to extract data, if my python server doesn't crash, zope returns the following:
> Error, MySQL.error: have an error in your SQL syntax near ' '', '', '', 2000 )' at line 3 
> --------------------------------------------------------------------------------
> SQL used:
> 
> SELECT * FROM songdetails
> WHERE(
>      '',
>      '',
>      '',
>      '',
>      2000
>      )

2 pieces of advice.  

1)  Omigod ME?  Use NT, or linux.  You will crash a lot
less.

2)  don't use position notation in SQL.  
select * from songdetail where some_column_name=2000 and some_other_column=''
  and yet_another_column=''
will be much more robust.  If the table is ever deleted and recreated,
it is not unusual for columns to move, and in any event the way you 
are doing it requires you to count arguments exactly.

2b) is this parsed as a subselect?

jim

> 
> I'd be most grateful if you could provide some answers to any of these probelms as soon as you can. Even if you don't know if you could point me in the direction of someone who does.
> 
> Cheers
> 
> Alan