Jump to content

Can't connect to database server :


LeMarque

Recommended Posts

Was just made aware of this by someone that received the above error after completing the form on the registration page and clicking submit. Verified it myself. Strange thing is the account IS created and the user does receive a welcome e-mail.

 

Tried the standard stuff - check/optimize/repair db - but still get the error. Refreshing the page WHMCS says 'user already exists with that name.

 

Could use any feedback while I grope around in the dark.

Link to comment
Share on other sites

Hi Lance,

 

Would be good to know which one, I cant see it being the NE1-IDP module as that doesnt touch the database.

 

Which leaves the sync module, this module is designed to sync any changed information from the client area (name, address, email etc) to NetEarth One so that you always have the most up to date information at NE1 (after customer updates it on WHMCS that is).

 

This does connect to the local database, to store the old information, before sending it to NE1.

 

Here is the code :

 

Look for the function actionhook_ClientSignup($vars)

 

Inside this function paste the following code:

 

include("../configuration.php");

$conn = mysql_connect($db_host, $db_username, $db_password);

if (!$conn) {

die('Can\'t connect to database server : ' . mysql_error());

}

$db_selected = mysql_select_db($db_name, $conn);

if (!$db_selected) {

die ('Can\'t select database : ' . mysql_error());

}

$clientid = $vars["ClientID"];

$email = $vars["Email"];

# Update special table

$q = "INSERT INTO tblclientsold(id,email) VALUES ('$clientid','$email')";

$result = mysql_query($q,$conn);

if (!$result) {

die("MySQL Error! Please go back to the previous page and try again.");

}

 

Scroll down to the next function actionhook_ClientDetailsEdit($vars)

 

Inside this function paste the following code:

 

# Client ID from var

include("details.php");

$clientid = $vars["ClientID"];

$path = $_SERVER['SCRIPT_FILENAME'];

if(eregi('admin', $path)) {

$type = 1;

} else {

$type = 2;

}

$directurl = "http://" . $_SERVER['HTTP_HOST']."/".$INSTALL_DIR."/includes/updateUser.php?id=$clientid&type=$type";

echo "<script type=\"text/javascript\">

<!--

window.location = \"$directurl\"

//-->

</script>";

 

With obviously doing an upload of the NE1lb directory, updating the details.php file, thats about it.

 

Ill get this tested on my 372.

 

Chris

Link to comment
Share on other sites

Thanks Chris.

 

I'm worn out - the NE1 Mods were the last thing I checked - and did spend quite a bit of time double and triple checking.

 

But my recollection, which could be wrong, was that immediately after replacing the Mod'd clientareadomaindetails.tpl ala NE1-IDP module, the error stopped.

 

So, I'll start with re-loading that Mod tomorrow.

 

-

 

Lance

Link to comment
Share on other sites

  • 3 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated