Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [MySQL][PHP]Pobranie dwóch tabel
tenloginjestzaje...
post
Post #1





Grupa: Zarejestrowani
Postów: 358
Pomógł: 1
Dołączył: 20.07.2014

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


Witam mam problem, nie wiem jak pobrać dwie tabele, do pobrania jednej używam:
  1. $query1 = mysql_query("SELECT DISTINCT `tag` FROM `comments`");
  2. while($row = mysql_fetch_assoc($query1)){echo '';}


Potrzebuje jeszcze pobrać:

  1. $query1 = mysql_query("SELECT DISTINCT `tag` FROM `tags`");
  2. while($row = mysql_fetch_assoc($query1)){echo '';}


Tak żeby w jednym echo były wniki z dwóch tabel. Dziękuje
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
tenloginjestzaje...
post
Post #2





Grupa: Zarejestrowani
Postów: 358
Pomógł: 1
Dołączył: 20.07.2014

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


dziękuje, ale teraz błąd:


W index.php wstawiam:
  1. include('config2.php');
  2. $mysql1 = new MySQL('xxx','xxx', 'xxx', 'xxx');

Działa.

  1. include('config2.php');
  2. $mysql2 = new MySQL('xxx','xxx', 'xxx', 'xxx');

Fatal error: Cannot redeclare class MySQL in /home/config2.php on line 2
Go to the top of the page
+Quote Post
tomxx
post
Post #3





Grupa: Zarejestrowani
Postów: 172
Pomógł: 27
Dołączył: 5.10.2013

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


Cytat(tenloginjestzajety @ 4.07.2015, 22:55:45 ) *
dziękuje, ale teraz błąd:


W index.php wstawiam:
  1. include('config2.php');
  2. $mysql1 = new MySQL('xxx','xxx', 'xxx', 'xxx');

Działa.

  1. include('config2.php');
  2. $mysql2 = new MySQL('xxx','xxx', 'xxx', 'xxx');

Fatal error: Cannot redeclare class MySQL in /home/config2.php on line 2

Wobec tego gdzieś masz dwa razy zadeklarowaną klasę, sprawdź wszystkie pliki, które tu includujesz i które includujesz w pliku config2.

Ten post edytował tomxx 4.07.2015, 22:00:34
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: 27.12.2025 - 22:14