Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Closed TopicStart new topic
> [PHP] błędy podczas logowania
martines
post
Post #1





Grupa: Zarejestrowani
Postów: 3
Pomógł: 0
Dołączył: 14.09.2009

Ostrzeżenie: (0%)
-----


Umieściłem stronkę w Wamp Server i chciałem umieścić logowanie do stronki.
Podczas logowania wyskakują błędy :

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'admin'@'localhost' (using password: YES) in C:\wamp\www\class.DB.php on line 12

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in C:\wamp\www\class.DB.php on line 13

Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in C:\wamp\www\class.DB.php on line 14

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in C:\wamp\www\class.DB.php on line 26

Warning: mysql_error(): supplied argument is not a valid MySQL-Link resource in C:\wamp\www\class.DB.php on line 47

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\wamp\www\class.DB.php on line 30


A o to plik class.DB

<?php
require_once('class.config.php');

class DB{

protected $db;
protected $query_result;
private static $instance;

private function __construct(){
$config = config::singleton();
$this->db = mysql_connect($config->host, $config->user, $config->pass);
mysql_query("SET NAMES uft8",$this->db);
mysql_select_db($config->db, $this->db);
}

public static function singleton() {
if (!isset(self::$instance)) {
$c = __CLASS__;
self::$instance = new $c();
}
return self::$instance;
}

public function send_query($query){
$this->query_result = mysql_query($query,$this->db);
}

public function getRow(){
if ( $row = mysql_fetch_array($this->query_result, MYSQL_ASSOC) ){
return $row;
}else{
return false;
}
}

public function rowCount(){
return mysql_num_rows($this->query_result);
}

public function getInsertedId(){
return mysql_insert_id($this->db);
}

public function isQueryError(){
if ($this->query_result === false){
return mysql_error($this->db);
}else{
return false;
}
}

public function change_db($db){
if(mysql_select_db($db)){
return true;
}else{
return mysql_error();
}
}
}
?>


W pliku class.config mam ustawiony login i hasło.
Może coś pominąłem?
Może ktoś wie w czym tkwi błąd??
Go to the top of the page
+Quote Post
Eagle
post
Post #2





Grupa: Zarejestrowani
Postów: 170
Pomógł: 14
Dołączył: 16.03.2007

Ostrzeżenie: (0%)
-----


W bazie nie masz użytkownika 'admin' albo podałeś złe hasło w configu.
Go to the top of the page
+Quote Post
erix
post
Post #3





Grupa: Moderatorzy
Postów: 15 467
Pomógł: 1451
Dołączył: 25.04.2005
Skąd: Szczebrzeszyn/Rzeszów




Kpisz? No bez przesady...


--------------------

ZCE :: Pisząc PW załączaj LINK DO TEMATU i TYLKO w sprawach moderacji :: jakiś błąd - a TREŚĆ BŁĘDU? :: nie ponaglaj z odpowiedzią via PW!
Go to the top of the page
+Quote Post

Closed TopicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 21.08.2025 - 17:36