Quote:
Originally Posted by KirbyDE
Do you use the same username/password for the other database as for vBulletin?
Then this is the problem:
The code in check_membership will use the current connection (for vBulletin) - but you close the connection, so it won't be available in vBulletin any longer after the call.
Try
PHP Code:
$SAIMClink = mysql_connect( "localhost", "myUsername", "myPassword", true );
This should create a new link, even if user/password are the same.
Another approach would be to use vBulletins DB-Class, and change the DB upon call end return.
Or use a different user/password.
|
Alright. After a whole lot of testing and changing of code I found out that:
PHP Code:
// Custom check for membership
require_once('./includes/functions_membership.php');
if (!check_membership($_POST['memberid'], $_POST['membernumber']))
{
$errors[991] = "Invalid membership information given, please check.";
}
Should in fact be:
PHP Code:
// Custom check for membership
require_once('./includes/functions_membership.php');
if (check_membership($_POST['memberid'], $_POST['membernumber']))
{
$errors[991] = "Invalid membership information given, please check.";
}
I removed the "!" at the begining of the function, if you didn't catch it.
However it was the username and password stuff that was stopping me from accessing the DB. So thanks SO much for your help. I would never had guessed that was the problem!
So I'm sorted and happy and my programme is working great and all is right with the world!
Again thanks for your help!