The PHP manual says this of mysql_select_db:
"Sets the current active database on the server that's associated with the specified link identifier. Every subsequent call to mysql_query() will be made on the active database."
Zenphoto's query() functions don't use the second argument to mysql_query, so it uses the latest connection from mysql_select_db to run the query, which is wrong.
It's now fixed in SVN and will be in the next release. Until then edit line 25 of `functions-db.php` from:
`$result = mysql_query($sql) or die(....);`
to
`$result = mysql_query($sql, $mysql_connection) or die(....);`
Sorry for not using the connection, that's my bug.