The simpler media website CMS
// Make the connnection and then select the database.
$dbc = @mysql_connect ('localhost', 'hilcrest_shows', 'shows') OR die ('Could not connect to MySQL: ' . mysql_error() );
mysql_select_db ('hilcrest_shows', $dbc) OR die ('Could not select the database: ' . mysql_error() );
function escape_data ($data) {
global $dbc; // Need the connection.
if (ini_get('magic_quotes_gpc')) {
$data = stripslashes($data);
}
return mysql_real_escape_string($data, $dbc);
} // End of function.
?>
`
Comments
"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.