I have a similar error to the above. I find that when trying to apply changes to the included themes, i get this error.
I'm using the current (as of 01/02/11) version. If I goto themes and then on a particular theme, click "Set [themename] theme options", and then try to apply changes, i get the following error:
Zenphoto encountered an error
MySQL Query ( SELECT `name`, `value`, `id` FROM `zp_options` WHERE `name`='Allow_search' AND `ownerid`= AND `theme`='default' ) failed. MySQL returned the error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND `theme`='default'' at line 1
Backtrace:
-> query (functions-db-MySQL.php [90])
-> query_single_row (functions.php [1937])
-> setThemeOption (admin-functions.php [857])
-> processCustomOptionSave (admin-options.php [414])
However, if I activate a theme and then edit it's options by clicking "options" then "themes", I can apply changes successfully.