Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [MySQL][PHP]Acces denied for user ?
Parg
post
Post #1





Grupa: Zarejestrowani
Postów: 32
Pomógł: 0
Dołączył: 18.12.2010

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


witam
mam problem i nei wiem jak go rozwiazac juz probowalem niektorych rzeczy ale nic nie pomoglo

wyskakuje mi to

Warning: mysql_query() [function.mysql-query]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\Program Files\VertrigoServ\www\sssaw\db_fns.php on line 25

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in C:\Program Files\VertrigoServ\www\sssaw\db_fns.php on line 25

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in C:\Program Files\VertrigoServ\www\sssaw\db_fns.php on line 26

a oto kod
laczenie z baza
  1. <?php
  2. function db_connect()
  3. {
  4. $conn = mysql_connect('localhost','root','vertrigo');
  5. if(!$conn)
  6. {
  7. }
  8. if(!$db = mysql_select_db("nova"))
  9. {
  10. }
  11. return $conn;
  12.  
  13. }
  14.  
  15. function get_user($login,$haslo)
  16. {
  17. db_connect();
  18. $query = ("SELECT * FROM uzytkownik WHERE login='$login' AND password='$haslo'");
  19. }
  20.  
  21. $result = mysql_query($query);
  22. $row = mysql_fetch_assoc($result);
  23. return $row;
  24.  
  25. ?>

sprawdzanie loginu
  1. <?php
  2.  
  3. include("db_fns.php");
  4. $row = get_user($_POST['login'],$_POST['haslo']);
  5. if($row)
  6. {
  7. $_SESSION['id']=$row['login'];
  8.  
  9.  
  10. header("Location: index_heroes.php");
  11. }
  12. else
  13. {
  14. echo"Nie posiadasz konta na Heros VS";
  15. }
  16. ?>
  17. <div id="reg"><a href="register.php" title="Tu możesz utworzyć swoje konto">Zarejestruj się</a></div>



prosze pomozcie
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 24.08.2025 - 14:17