Jump to content

Down for Maintenance (Err 2) An upgrade is currently in progress... Please come back


tslin

Recommended Posts

I recently upgraded my whmcs version from 5.0.3 to 5.2.3.

I'm having a problem with "dbconnect.php" to execute a sql statement.

Following is the code in my Sample.php file located at whmcs_dir/Service directory.

This file was used to call whmcs APIs from my site via HttpWebRequest.

---------------------------------------------------

if( isset($_POST) )

{

if( $_POST["action"] == "addorder")

{

// codes to call whmcs addorder api goes here and order was successfully saved into whmcs database.

// after saving order, i need to execute one sql statement to meet with my project needs.

 

$SQL = "UPDATE tblhosting SET username='xxx', domain='xxx' WHERE orderid=123";

ExecuteQuery($SQL);

}

}

 

function ExecuteQuery($SQL)

{

define("CLIENTAREA", true);

 

require("../dbconnect.php");

require("../includes/functions.php");

require("../includes/clientareafunctions.php");

$result = mysql_query( $SQL ) or die (mysql_error());

}

---------------------------------------------------

In ExecuteQuery(...) function, after line 2 - require("../dbconnect.php"); ,

I got the error "Down for Maintenance (Err 2) An upgrade is currently in progress... Please come back soon ... ".

 

Complete html codes returned to my HttpWebRequest is:

 

<div style="border: 1px dashed #cc0000;font-family:Tahoma;background-color:#FBEEEB;width:100%;padding:10px;color:#cc0000;"><strong>Down for Maintenance (Err 2)</strong><br>An upgrade is currently in progress... Please come back soon...</div>

 

I also tried with whmcs SQL helper function as follow but got the same result.

 

$table = "tblhosting";

$update = array("username"=>"xxx","domain"=>"xxx");

$where = array("orderid"=>"123");

update_query($table,$update,$where);

---------------------------------------------------

 

In WHMCS faq, this error occurs because of version mismatch between server files and database.

But strange thing is that if I take out the line - require("../dbconnect.php"); from function "ExecuteQuery(...)"

and put before calling that function, it works fine. So, I don't think this is because of version.

 

$SQL = "UPDATE tblhosting SET username='xxx', domain='xxx' WHERE orderid=123";

require("../dbconnect.php");

ExecuteQuery($SQL);

 

Any idea?

functions.php and clientareafunctions.php have no problem.

Is there anything that I need to configure to make this work?

 

Thanks in advance!

Link to comment
Share on other sites

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