can't connect to MySQL all of a sudden, PHP My Admin still works
i'm making a database driven website and everything works perfect. but, every once in a while, i'm unable to connect to MySQL from my own script. out of the blue it just will not connect. however, PHP My Admin will always connect without problems.
does anyone have a clue why i'm having this problem, and how to fix it? my solution has always been to haggle for a few hours and reinstall MySQL etc which is a pain.
function global_DbQuery($selection, $input, $extra1, $extra2, $extra3){
// Calling values from outside the function
global $text_Db_ErrorConnection, $text_Db_ErrorDatabaseSelection, $text_Db_ErrorDbQueryNotSelected, $text_Db_ErrorDbQueryNotAvailable, $global_PathIncludesSite;
// INSERT, SELECT, DELETE queries only
if ($selection <= 999){
// put each value from array on a single line, add commas
foreach ($input as $key => $input2){$value .= global_QuoteValue($input2); if ($key < (count($input) -1)){$value .= ', ';}}
}
// UPDATE queries only
elseif (($selection >1000) and ($selection <=1999)){
// keep array as is, set $value = $input
$value = $input;
}
// include database info and custom database queries for website
include $global_PathIncludesSite.'dbInterface.php';
// Connecting to, and selecting database
$db_connection = mysql_connect($db_Server, $db_Username, $db_Password)
or die($text_Db_ErrorConnection . mysql_error());
mysql_select_db($db_Database) or die($text_Db_ErrorDatabaseSelection);
I'm new to mysql but I noticed the same thing. I went into the 'mysql Admin\useradministration\"user" \ resource' here you will find three setting max_questions: max_updates: max_connection: increase these to a number that will allow you to test you code. Once your done and ready to co to production lower the numbers.
I hope this helps