Jump to content

PLEASE HELP, error message "cannot select database" PLEASE HELP


ak_mypayday

Recommended Posts

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");

?>

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");

?>

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.

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.