Thanks Brad,
I'm afraid I DO need separate credentials - those're the rules of my host 🙂
The code, like me in many ways, is really very simple:
cmsconn.php
$cmshost = 'localhost';
$cmsuser = 'sypcms';
$cmspass = 'my_pass';
$cmsname = 'sypcms';
mysql_connect($cmshost, $cmsuser, $cmspass);
mysql_select_db($cmsname);
memconn.php is almost identical - just replace anything that says "cms" with "memm".
In my pages, the code would be along the line of:
<?php
//Check user is logged in and process login script
//this uses memconn.php succesfully with the code
//require_once("../includes/memconn.php");
include ("/logincheck.inc");
//now connect to the cms to get page/nav content
require_once("../includes/cmsconn.php");
mysql_query("select * from sypcms");
//now (on certain pages) connect to membership db again to retrieve user info allowing them to edit their profile
require_once("../includes/memconn.php");
mysql_query("select * from membership");
The problem is occurring with this second instance of memconn.php. I get the error message "Error in Query: .Access denied for user: 'sypcms@localhost' to database 'membership' " indicating that it's still trying to use the credentials from cmsconn.php, however when I echo those credentials as part of the page load process, it's bringing up the correct stuff.
If I just paste the contents of memconn.php directly into the page, it works fine!
I'm thinking (as I type) that require_once() might be part of the problem, but I don't know what to do about it!
Thanks again for your help!