ZenphotoCMS Forum
Database Conflict - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: General support (https://forum.zenphoto.org/forum-4.html)
+--- Thread: Database Conflict (/thread-991.html)



Database Conflict - ambithium - 2006-12-17

Hey everyone. I've got a database where I store some info that I call on every page's header. It's a band most recent show. However, when including my SQL connect, something's conflicting and ZenPhoto begins looking in the show's database instead of it's own.

I've included the offending code at the bottom. Am I using a shared function or something?

`

`




Database Conflict - trisweb - 2006-12-19

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.




Database Conflict - ambithium - 2006-12-19

Ah, perfect. Worked like a charm. Good to see this will be in future releases. Thanks for the perfect support!




Database Conflict - trisweb - 2006-12-20

My pleasure Thanks for using Zenphoto.