This is my Config For MysqlWarning: mysql_connect() [function.mysql-connect]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\wamp\www\armory\configuration\mysql.php on line 100
Unable to connect to Character SQL database: No database selected
Notice: Undefined index: Killed On Contact PvP in C:\wamp\www\armory\source\honorranking.php on line 23
Notice: Undefined index: in C:\wamp\www\armory\configuration\mysql.php on line 97
Notice: Undefined index: in C:\wamp\www\armory\configuration\mysql.php on line 107
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in C:\wamp\www\armory\source\honorranking.php on line 85
What Might I have to do?Code:<?php /* --- MySQL Connection Handler --- */ /* --- This is an Example --- Multirealm Configuration Array Usage: "Realm Name" => array( "ConnectionKey" , "DB User" , "DB Pass" , "DB Host" , "Char DB" , "World DB" ) , For example: $realms = array( "Test Realm" => array( "TESTREALM" , "root" , "ascent" , "localhost" , "Char" , "world" ) , ); Note 1: "ConnectionKey" must NOT have any spaces in it, underscores are acceptable. Note 2: "Char DB" is the database that you use for your characters, NOT your world database. Note 3: Added the entry for world DB, but it's not operational yet (I.E. Not used) --- This is an Example --- */ /* Set your details here */ $realms = array( "Realm name" => array( "ConnectionKey" , "root" , "Pass" , "localhost" , "Logon" , "Ascent" ), ); /* Default Realm if not set */ $realmName["DEFAULT_REALM"] = "Killed On Contact PvP"; $MySQL_User["DEFAULT_REALM"] = $realms[$realmName["DEFAULT_REALM"]][1]; $MySQL_Password["DEFAULT_REALM"] = $realms[$realmName["DEFAULT_REALM"]][2]; $MySQL_Host["DEFAULT_REALM"] = $realms[$realmName["DEFAULT_REALM"]][3]; $RealmDB["DEFAULT_REALM"] = $realms[$realmName["DEFAULT_REALM"]][4]; $WorldDB["DEFAULT_REALM"] = $realms[$realmName["DEFAULT_REALM"]][5]; /* Website Database Configuration -> May or may not have a seperate connection to your realmservers <- */ /* RealmDB must be the database used for your item_cache database */ $MySQL_User["WEBSITE"] = "root"; $MySQL_Password["WEBSITE"] = "Hidden"; $MySQL_Host["WEBSITE"] = "localhost"; $RealmDB["WEBSITE"] = "Armory"; $WorldDB["WEBSITE"] = "Ascent"; /* WorldServer DB if applicable */ $MySQL_User["WSERVER"] = $MySQL_User["DEFAULT_REALM"]; $MySQL_Password["WSERVER"] = $MySQL_Password["DEFAULT_REALM"]; $MySQL_Host["WSERVER"] = $MySQL_Host["DEFAULT_REALM"]; $RealmDB["WSERVER"] = $RealmDB["DEFAULT_REALM"]; $WorldDB["WSERVER"] = $WorldDB["DEFAULT_REALM"]; // ? I seriously can't remember what WSERVER is used for anymore (looks like it's items and playercreateinfo, might be depreceated code tho.. // /* Uncommenting these lines is highly unadvisable, especially the 'print_r( $MySQL_Password)' line. Use only on debug/local machines. print_r( $MySQL_User ); print_r( $MySQL_Password ); print_r( $MySQL_Host ); print_r( $RealmDB ); */ /* Don't touch anything beyond this point. */ foreach( $realms as $key => $val ) { $realmName[$val[0]] = $key; $MySQL_User[$val[0]] = $val[1]; $MySQL_Password[$val[0]] = $val[2]; $MySQL_Host[$val[0]] = $val[3]; $RealmDB[$val[0]] = $val[4]; $WorldDB[$val[0]] = $val[5]; } function switchDatabase( $realm , $db_type = 'character' ) { global $RealmDB, $WorldDB, $current_db; /* This function is called instead of mysql_select_db now that multirealms are implemented */ if( $db_type == 'character' ) { if( $current_db != sha1( $RealmDB[$realm] ) ) { mysql_select_db( $RealmDB[$realm] ) or print "Unable to connect to Character SQL database: " . mysql_error(); $current_db = sha1( $RealmDB[$realm] ); } } else { mysql_select_db( $WorldDB[$realm] ) or print "Unable to connect to World SQL database: " . mysql_error(); $current_db = sha1( $WorldDB[$realm] ); } } function switchConnection( $key , $db_type = 'character' ) { global $MySQL_User, $MySQL_Password, $MySQL_Host, $RealmDB, $WorldDB, $current_connection, $current_db, $querystack; /* Key - The key of the array used (i.e. $MySQL_User[<key>])*/ if( $current_connection != sha1( $MySQL_Host[$key] ) ) { /* Don't need to reconnect twice to the same DB */ mysql_connect( $MySQL_Host[$key], $MySQL_User[$key] , $MySQL_Password[$key] ) or print " " . mysql_error(); $current_connection = sha1( $MySQL_Host[$key] ); $querystack[] = array( "query" => "Connected to " . $key . "." , "time" => 0 , "line" => 0 , "function" => "switchConnection" ); } if( $db_type == 'character' ) { if( $current_db != sha1( $RealmDB[$key] ) ) { mysql_select_db( $RealmDB[$key] ) or print "Unable to connect to Character SQL database: " . mysql_error(); $current_db = sha1( $RealmDB[$key] ); } } else { mysql_select_db( $WorldDB[$key] ) or print "Unable to connect to World SQL database: " . mysql_error(); $current_db = sha1( $WorldDB[$key] ); } } function getConnection() { global $current_connection; return $current_connection; } function getDatabase() { global $current_db; return $current_db; } /* Default Connection: Website DB */ switchConnection( "WEBSITE" ); switchDatabase( "WEBSITE" ); ?>





Reply With Quote

