Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP][MYSQL]Wyciągnięcie danych z bazy
lucca
post
Post #1





Grupa: Zarejestrowani
Postów: 29
Pomógł: 2
Dołączył: 7.03.2008

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


Mam wielki problem, ale od początku.

Mam tabelkę, w bazie. Do niej dodaję sobie poszczególne koncerty z tras koncertowych. Zachciało mi się, aby po najechaniu na link, w hoverze wyskakiwał dymek, który wyświetli wszystkie koncerty z danego dnia.

Kod odpowiedzialny za to:
  1. <?php
  2. foreach ($this->links as $val) {
  3. $id = $val['id'];
  4. $type = $val['type'];
  5. $day = $val['day'];
  6. $month = $val['month'];
  7. $year = $val['year'];
  8. $band = $val['band'];
  9. $name = $val['name'];
  10. $title = $val['title'];
  11. $desc = $val['desc'];
  12. $venue = $val['venue'];
  13. $city = $val['city'];
  14. $country = $val['country'];
  15. if (($val['day'] == $cellValue) && (($val['month'] == $this->month) || ($val['month'] == '*')) && (($val['year'] == $this->year) || ($val['year'] == '*'))) {
  16. $cell = '<a href="calendar.php?display=event&date='.$year.''.$month.''.$day.'" onmouseover="return overlib(''.$val['band'].' - '.$val['venue'].'');" onmouseout="return nd();">'.$cellValue.'</a>';
  17. ?>


Problem w tym, że hover pokazuje mi dane tylko dla tego określonego linku. To znaczy, jeśli jest w danym dniu więcej koncertów, to on mi pokazuje tylko ostatni wpis z tego dnia.

Można to jakoś rozwiązać? Przez ten upał już zupełnie zgłupialem (IMG:http://forum.php.pl/style_emoticons/default/sad.gif)

Pzdr
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
lucca
post
Post #2





Grupa: Zarejestrowani
Postów: 29
Pomógł: 2
Dołączył: 7.03.2008

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


Kod ma teraz postać:
  1. <?php
  2. $i=1;
  3. $chmurka=' onmouseover="return overlib(';
  4. $adres = "";
  5. $wpiswadres="";
  6. $q = mysql_query("select * from calendar");
  7. while ($val = mysql_fetch_array($q))
  8. {
  9. foreach ($this->links as $val) {
  10. $id = $val['id'];
  11. $type = $val['type'];
  12. $day = $val['day'];
  13. $month = $val['month'];
  14. $year = $val['year'];
  15. $band = $val['band'];
  16. $name = $val['name'];
  17. $title = $val['title'];
  18. $desc = $val['desc'];
  19. $venue = $val['venue'];
  20. $city = $val['city'];
  21. $country = $val['country'];
  22. if (($val['day'] == $cellValue) && (($val['month'] == $this->month) || ($val['month'] == '*')) && (($val['year'] == $this->year) ||
  23. ($val['year'] == '*'))) {
  24.  if ($i==1)
  25.  {
  26.  $adres = "calendar.php?display=event&date='.$year.''.$month.''.$day";
  27.  $wpiswadres = $cellValue;
  28.  
  29.  }
  30.  $chmurka.=''.$val['band'].' - '.$val['venue'].'';
  31.  }
  32. }
  33. $chmurka.="'";
  34. $cell = '<a href="'.$adres.' '.$chmurka.' onmouseout="return nd();">'.$wpiswadres.'</a>';
  35. break;
  36.  
  37. }
  38. }
  39. ?>


Zwraca błąd :
  1. <?php
  2. [b]Parse error[/b]: syntax error, unexpected '}' in [b]/home/pedro/www/test/quick_calendar.php[/b] on line [b]321[/b]
  3. ?>


Już zgłupiałem

Fakt, już wiem gdzie problem.

Lecz gdy z fragmentu
  1. <?php
  2. }
  3. }
  4. ?>

usunę jedną klamrę, to strona ładuje się cały czas
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: 3.10.2025 - 01:17