Mam plik news.php, w którym includuje się plik comments.php jeżeli zmienna "mod" bedzie równała się comments (mod=comments), no i wszystko śmiaga, ale gdy już w pliku articles.php zrobie to samo to wywala mi błąd
Cytat
Warning: mysql_query() [function.mysql-query]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\wamp\www\lee\cms\library\mysql.class.php on line 27

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in C:\wamp\www\lee\cms\library\mysql.class.php on line 27
Błąd [3]: Wystąpił błąd podczas wykonywania zapytania
Access denied for user 'ODBC'@'localhost' (using password: NO)


Co może być tego przyczyną ?

Skrócony (wywaliłem co niepotrzebne) kod news.php
  1. <?php 
  2.  
  3. require("config.php");
  4.  
  5. if (empty($_GET['mod'])) {
  6. /...
  7. }
  8. else if ($_GET['mod'] == 'more') {
  9. //...
  10. }
  11. else if ($_GET['mod'] == 'comments') {
  12. if (is_numeric($_GET['id'])) {
  13. require_once('comments.php');
  14. }
  15. }
  16.  
  17. $smarty -> display("$theme/news.tpl");
  18. ?>


comments.php (skrócony)
  1. <?php 
  2.  
  3. require("config.php");
  4.  
  5. if (is_numeric($_GET['id'])) {
  6. if ($module == 'index') {
  7. $id = $_GET['id'];
  8. $db_query = "SELECT * FROM $tbl_comments WHERE what_id='$id' AND what='news'";
  9. $mysql -> fetch_assoc($db_query);
  10. $smarty -> assign('comments', $mysql -> row);
  11. $smarty -> assign('type', 'news');
  12. $smarty -> assign('action', $module);
  13.  
  14. }
  15. else if ($module == 'articles') {
  16. $id = $_GET['id'];
  17. $db_query = "SELECT * FROM $tbl_comments WHERE what_id='$id' AND what='news'";
  18. $mysql -> fetch_assoc($db_query);
  19. $smarty -> assign('comments', $mysql -> row);
  20. $smarty -> assign('type', 'news');
  21. $smarty -> assign('action', $module);
  22. }
  23. }
  24.  
  25. $smarty -> display("$theme/comments.tpl");
  26.  
  27. ?>


articles.php
  1. <?php
  2.  
  3. require("config.php");
  4.  
  5. if (empty($_GET['id']) && empty($_GET['cat'])) {
  6.  //...
  7. }
  8. else if (empty($_GET['id']) && !empty($_GET['cat'])) {
  9. //...
  10. }
  11. else if (!empty($_GET['id']) && !empty($_GET['cat'])) {
  12.  if (is_numeric($_GET['cat'])){
  13. if (empty($_GET['mod'])){
  14. //..
  15. }
  16. else {
  17. if (is_numeric($_GET['id'])) {
  18. require_once('comments.php');
  19. }
  20. }
  21.  } else { header ('Location: articles.php'); }
  22. }
  23.  
  24. $smarty -> display("$theme/index.tpl");
  25. ?>


w pliku config.php mam require_once("mysql.class.php") i tam mam zdefiniowane połączenie z bazą (w config) czyli $connect = new Connect(...); i $MySQL = new MySQL;

Tylko odpowiedzcie cokolwiek, bo stoje ze skryptem od tygodnia bo przyczyny nie mogę znaleźc :/