i need help with the specific db queries problem. My site is hosted on ipage which limits max questions to 70000 queries per hour per user for a database. For some reason my site goes down quite often because it goes over this limit. To put it online i manually change the db user in configuration.php file.
The solution would be the rotating mysql login script where it either chooses one of these usernames randomly to login to the database or a username in a set order to log in with an array. That way is increases my queries to 210,000 per hour.
I found such a script for drupal which switches 3 users randomly. That's what i need but for joomla. Since my knowledge in this field is very basic i'd like to ask for the advice to correct this script to use it in joomla configuration.php file.
Any help is greatly appreciated!
Here is the drupal script:
Code: Select all
$db_user_array = 'mysql://username1:email@example.com/database_drupal1'; //enter 1st user name $db_user_array = 'mysql://username2:firstname.lastname@example.org/database_drupal1'; //enter 2nd user name $db_user_array = 'mysql://username3:email@example.com/database_drupal1'; //enter 3rd user name $db_url = $db_user_array[ rand( 0, ( sizeof($db_user_array) -1 ) ) ];