ak_mypayday Posted February 20, 2008 Share Posted February 20, 2008 Can someone tell me what the problem is with the script? I've got the database info correct but it won't select it. <?php $dbHost = "localhost"; $dbUsername = "getmacro_admin"; $dbPass = "KA_Kuy05"; $dbName = "getmacro_members"; ///////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////////// // DO NOT EDIT BELOW THIS LINE ///////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////////// $dbCon = @mysql_connect($dbHost, $dbUsername, $dbPass); if(!$dbCon) exit("Cannot make a connection to the database server.<BR>"); $dbSelect = @mysql_select_db($dbName); if(!$dbSelect) exit("Cannot select a database.<BR>"); ini_set("register_globals", "on"); ///////////////////////////////////////////////////////////////////////////////////////////////////////////// // Cleanly escape mysql values for direct insertion into a mysql_query ///////////////////////////////////////////////////////////////////////////////////////////////////////////// if(!function_exists("quote_smart")) { function quote_smart($value) { // Stripslashes if (get_magic_quotes_gpc()) { $value = stripslashes($value); } // Quote if not integer if (!is_numeric($value)) { $value = "'" . mysql_real_escape_string($value) . "'"; } else { $value = "'" . $value . "'"; } return $value; } } extract(mysql_fetch_array(mysql_query("SELECT * FROM setupinfo"))); include("functions.php"); ?> Quote Link to comment Share on other sites More sharing options...
revraz Posted February 20, 2008 Share Posted February 20, 2008 You DB, ID or PW is wrong. Quote Link to comment Share on other sites More sharing options...
ak_mypayday Posted February 20, 2008 Author Share Posted February 20, 2008 Nope that's not the problem. I created the database while updating the script. Quote Link to comment Share on other sites More sharing options...
digitalgod Posted February 20, 2008 Share Posted February 20, 2008 try this $dbSelect = @mysql_select_db($dbName,$dbCon); if(!$dbSelect) die( mysql_error() ); Quote Link to comment Share on other sites More sharing options...
ak_mypayday Posted February 20, 2008 Author Share Posted February 20, 2008 now i get a message that says "cannot connect to database server" this is the revised script <?php $dbHost = "localhost"; $dbUsername = "getmacro_admin"; $dbPass = "KA_Kuy05"; $dbName = "getmacro_members"; ///////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////////// // DO NOT EDIT BELOW THIS LINE ///////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////////// $dbCon = @mysql_connect($dbHost, $dbUsername, $dbPass); if(!$dbCon) exit("Cannot make a connection to the database server.<BR>"); $dbSelect = @mysql_select_db($dbName,$dbCon); if(!$dbSelect) die( mysql_error() ); ini_set("register_globals", "on"); ///////////////////////////////////////////////////////////////////////////////////////////////////////////// // Cleanly escape mysql values for direct insertion into a mysql_query ///////////////////////////////////////////////////////////////////////////////////////////////////////////// if(!function_exists("quote_smart")) { function quote_smart($value) { // Stripslashes if (get_magic_quotes_gpc()) { $value = stripslashes($value); } // Quote if not integer if (!is_numeric($value)) { $value = "'" . mysql_real_escape_string($value) . "'"; } else { $value = "'" . $value . "'"; } return $value; } } extract(mysql_fetch_array(mysql_query("SELECT * FROM setupinfo"))); include("functions.php"); ?> Quote Link to comment Share on other sites More sharing options...
digitalgod Posted February 21, 2008 Share Posted February 21, 2008 ok so there is a problem with either your username, password or db name, when you created that db make sure you assigned to it a user Quote Link to comment Share on other sites More sharing options...
ak_mypayday Posted February 21, 2008 Author Share Posted February 21, 2008 ok so there is a problem with either your username, password or db name, when you created that db make sure you assigned to it a user That couldn't be it. I've checked, I can install any other script, I just can't get this one to work. Quote Link to comment Share on other sites More sharing options...
neylitalo Posted February 21, 2008 Share Posted February 21, 2008 Can you connect to other databases? Quote Link to comment Share on other sites More sharing options...
ak_mypayday Posted February 21, 2008 Author Share Posted February 21, 2008 Yes with other scripts I can just fine. Quote Link to comment Share on other sites More sharing options...
revraz Posted February 21, 2008 Share Posted February 21, 2008 Why do you use @ then use a die with a error? Makes no sense. Quote Link to comment Share on other sites More sharing options...
ak_mypayday Posted February 21, 2008 Author Share Posted February 21, 2008 Thank you everyone! Problem resolved Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.