PHP forums, MySQL forums, Web Development resources

Home PageHome    PHP ResourcesTopic List    FAQFAQ    SearchSearch    MemberlistMemberlist    UsergroupsUsergroups 
 RegisterRegister
    ProfileProfile    Log in to check your private messagesLog in to check your private messages    Download the RSS Reader RSS Feed Download the RSS Reader RSS for this forum Log inLog in 

PHP Forum :: MySQL Forum :: Java Script Forum



Please Guide Me

 
Post new topic   Reply to topic    WeberForums.com Forum Index -> PHP General
View previous topic :: View next topic  
Author Message
johnsmith5082



Joined: 04 Jul 2009
Posts: 1

PostPosted: Sat Jul 04, 2009 9:37 am    Post subject: Please Guide Me Reply with quote

Dear friends,
What is the real problem here! Please Guide and reply me.

config.php

<?php

// Database Constants
defined('DB_SERVER') ? null : define("DB_SERVER", "38.107.141.151");
defined('DB_USER') ? null : define("DB_USER", "easyteck_arun");
defined('DB_PASS') ? null : define("DB_PASS", "************");
defined('DB_NAME') ? null : define("DB_NAME", "easyteck_photogallery");
?>


[[color=orange]b]database.php[/b]
<?php


require_once('/home/easyteck/public_html/itunes/includes/config.php');

class MySQLDatabase {

private $connection;
public $last_query;
private $magic_quotes_active;
private $real_escape_string_exists;

function __construct() {
$this->open_connection();
$this->magic_quotes_active = get_magic_quotes_gpc();
$this->real_escape_string_exists = function_exists( "mysql_real_escape_string" );
}

public function open_connection() {
$this->connection = mysql_connect(DB_SERVER , DB_NAME, DB_USER, DB_PASS );
if (!$this->connection) {
die("Database connection failed: " . mysql_error());
} else {
$db_select = mysql_select_db(DB_NAME, $this->connection);
if (!$db_select) {
die("Database selection failed: " . mysql_error());
}
}
}

public function close_connection() {
if(isset($this->connection)) {
mysql_close($this->connection);
unset($this->connection);
}
}

public function query($sql) {
$this->last_query = $sql;
$result = mysql_query($sql, $this->connection);
$this->confirm_query($result);
return $result;
}

public function escape_value( $value ) {
if( $this->real_escape_string_exists ) { // PHP v4.3.0 or higher
// undo any magic quote effects so mysql_real_escape_string can do the work
if( $this->magic_quotes_active ) { $value = stripslashes( $value ); }
$value = mysql_real_escape_string( $value );
} else { // before PHP v4.3.0
// if magic quotes aren't already on then add slashes manually
if( !$this->magic_quotes_active ) { $value = addslashes( $value ); }
// if magic quotes are active, then the slashes already exist
}
return $value;
}

// "database-neutral" methods
public function fetch_array($result_set) {
return mysql_fetch_array($result_set);
}

public function num_rows($result_set) {
return mysql_num_rows($result_set);
}

public function insert_id() {
// get the last id inserted over the current db connection
return mysql_insert_id($this->connection);
}

public function affected_rows() {
return mysql_affected_rows($this->connection);
}

private function confirm_query($result) {
if (!$result) {
$output = "Database query failed: " . mysql_error() . "<br /><br />";
//$output .= "Last SQL query: " . $this->last_query;
die( $output );
}
}

}

$database = new MySQLDatabase();
$db =& $database;

?>
[/color]

Error:

[color=brown]Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'easyteck_photoga'@'server.olympiasoftsol.com' (using password: YES) in /home/easyteck/public_html/itunes/includes/database.php on line 20
Database connection failed: Access denied for user 'easyteck_photoga'@'server.olympiasoftsol.com' (using password: YES).
[/color]
Back to top
View user's profile Send private message
lostboy



Joined: 02 May 2004
Posts: 6033
Location: toronto, canada

PostPosted: Sat Jul 04, 2009 9:54 pm    Post subject: Reply with quote

Either the username or password for the acou t is not correct. If you feel that they are correct then you need to double check the server account to ensure that your desired account can connect
Back to top
View user's profile Send private message Send e-mail AIM Address MSN Messenger
Display posts from previous:   
WeberTrivia Questions WeberTrivia Questions
 Think you are smart? Prove it!. Try your skills with these questions :
 WeberTrivia QuestionsRecursive arrays and multi-dimensional arrays are one and the same. (PHP and MySQL)
 WeberTrivia QuestionsThe \"cache_dir\" tag of the squid configuration has a default of /var/spool/squid. (Linux)

WeberTrivia Questions



Post new topic   Reply to topic    WeberForums.com Forum Index -> PHP General All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
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




Powered by phpBB © 2001, 2005 phpBB Group
PHP Forum :: MySQL Forum :: Java Script Forum