Member
Member
ambithium   2006-12-17, 20:27
#1

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?

`

`

Developer
Developer
trisweb   2006-12-19, 02:34
#2

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.

Member
Member
ambithium   2006-12-19, 18:40
#3

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

Developer
Developer
trisweb   2006-12-20, 07:56
#4

My pleasure Thanks for using Zenphoto.

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.