1
Max-Realms
Auto select next available db user in mainfile.php
  • 2005/3/29 19:50

  • Max-Realms

  • Just popping in

  • Posts: 20

  • Since: 2005/3/26


Hi is there a way to assign more than one db user in mainfile.php and have them selected automatically when the first (default) user has exceeded set resources?

This would be great for those of us with hosted servers with jerks for admin.

2
Max-Realms
Re: Auto select next available db user in mainfile.php
  • 2005/4/7 16:38

  • Max-Realms

  • Just popping in

  • Posts: 20

  • Since: 2005/3/26


So is this impossible? Or no-one knows how to do it. Or just doesn't care...

3
-DJNZ-
Re: Auto select next available db user in mainfile.php
  • 2005/4/7 18:41

  • -DJNZ-

  • Just popping in

  • Posts: 30

  • Since: 2005/1/11


Quote:

Max-Realms wrote:
So is this impossible? Nope.
Or no-one knows how to do it. Sure they do.
Or just doesn't care... You guessed it!

I would guess that most XOOPS users use hosts where MySQL useage is not limited by MySQL user, so they don't care. If you would rather spend time hacking code than negotiating a better hosting arrangement then:

In function connect() in class/database/mysqldatabase.php, replace the following code
if (XOOPS_DB_PCONNECT == 1) {
    
$this->conn = @mysql_pconnect(XOOPS_DB_HOSTXOOPS_DB_USERXOOPS_DB_PASS);
} else {
    
$this->conn = @mysql_connect(XOOPS_DB_HOSTXOOPS_DB_USERXOOPS_DB_PASS);
}

if (!
$this->conn) {
    
$this->logger->addQuery(''$this->error(), $this->errno());
    return 
false;
}

with something that loops over different values for XOOPS_DB_USER and XOOPS_DB_PASS (you will need to use an array variable rather than constants of course).

4
Max-Realms
Re: Auto select next available db user in mainfile.php
  • 2005/4/8 15:58

  • Max-Realms

  • Just popping in

  • Posts: 20

  • Since: 2005/3/26


I'm getting a new server in May, so this won't be a problem any more. However, I know I'm not the only person on a hosted server with this problem. Thank you for answering the post in that it may help someone else in the future.

Regards
David Goodman
www.max-realms.com

Login

Who's Online

73 user(s) are online (43 user(s) are browsing Support Forums)


Members: 0


Guests: 73


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Aug 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits