Thanks but my host dont allow me to have 2 or 3 users per database Ican have 20 databases but only one user(i am on shared hosing)...
If you have any other suggestions or ideas please write...
Donovan wrote:
I get this error whenever I get around 30 on the board at one time. My host has their limit set to 50,000 and they said "change your code to be more efficient". Here is the fix for this but I havn't been able to get it to work yet.
Datamisc Nuke Soldier
Joined: Nov 16, 2003
Posts: 10
Posted:
Tue Nov 23, 2004 11:07 am
Well i had this problem with ipowerweb... activated permanent connections and still had this problem... so i found a solution.
Im not a good coder but i discovered that if i created another account that directed to the same database then that account will start with 0 queries.
With that on mind i modified the includes/sql_layer.php so that if it encounters any database acces error it would instantly changed the user accesing the database.
this is the code : (sorry but its not well depured, i know many changes wil help making it better )
Code:
function sql_query($query, $id)
{
global $dbtype;
global $sql_debug;
$sql_debug = 0;
$incrementa = 0;
$i = 1;
$archivito="incrementa .php"; // NOTICE how there is a blank space after incrementa and before the dot
if($sql_debug) echo "SQL query: ".str_replace(",",", ",$query)."<BR>";
switch ($dbtype) {
case "MySQL":
$res=@mysql_query($query, $id);
//************************** prueba! ****************
if( (mysql_errno() || $res == NULL ) && mysql_errno() != 1054 ) /* Database error? */
{
echo mysql_errno();
while($i)
{
// The users are keept in a directory in root called cfg
// there are 7 diferent users... incrementa1... incrementa7
// one of them is always renamed to cfg.php
// we search the file missing (the one renamed to config2.php), then we rename it to the original name.
// example : we have in the cfg directory: incrementa1.php, incrementa3.php, ... incrementa 7.php
// so incrementa2.php is missing... we rename config2.php to incrementa2.php.
$archivito[9] = chr( $incrementa+49);
if ( !file_exists("cfg/$archivito") )
{
break;
}
$incrementa ++ ;
if( $incrementa == 7)
$i=0;
}
// now we will rename the next incrementa file to config2.php (the next user of the database)
// if we are at the end of the files (incrementa7) we start from 1
if($incrementa != 7 )
{
if( rename( "cfg/config2.php", "cfg/$archivito") ) {
if($incrementa == 6 )
{
$incrementa = 0;
}
else
{
$incrementa++;
}
$archivito[9] = chr( $incrementa + 49 );
rename ( "cfg/$archivito", "cfg/config2.php" );
NO incrementa1 is not missing... its config2... when the user in config2 reaches 50000queries then it will be renamed to incrementa1.php... and then incrementa2.php will be renamed to config2.php
each of the past files will contain the following code.
Code:
<?php
$dbuname = "database user";
?>
Remember to create diferent users for the same database (7) and put a diferent user in each file... keep the password the same in all users so it will be easier to change them.
It worked for me..
Stills needs lots of work... hope it works for you.
dannyb Nuke Cadet
Joined: Mar 08, 2005
Posts: 1
Posted:
Tue Mar 08, 2005 12:44 pm
I had this problem. There is a simple hack around it. If you are using a program simular to phpNuke.
First create a few different username/passwords for the db.
Then locate the db information file for that program.
Add a random module to set the db username and password randomly.
Instead of random you could do it by time, day,etc...
This will avoid the overload in querys by single user.
Problem persist then you should consult the make of the program if the hits do not match the query max out. For this would be a software problem.
DROPER Nuke Soldier
Joined: Jan 16, 2005
Posts: 13
Posted:
Mon May 02, 2005 4:28 am
Hello. I have a BIG problem.
I get this error: #1226 - User 'DRoPeR' has exceeded the 'max_questions' resource (current value: 90000)
A have read solution for this problem, but i can't create more that one username for one data base.
I don't know how to get out of this bug. Onyone who can help me. Please!!! I am running on PHP-NUKE 7.5
Sorry for my bad English.
DROPER Nuke Soldier
Joined: Jan 16, 2005
Posts: 13
Posted:
Mon May 02, 2005 9:22 am
People! Please help me. My site will go down every moment. Help me!
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum