Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> Problem z zapytaniem
sparky87
post
Post #1





Grupa: Zarejestrowani
Postów: 15
Pomógł: 0
Dołączył: 5.08.2006

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


Plik : branche.php
  1. <?php
  2. mysql_connect ("localhost","xxx","xxx");
  3. mysql_select_db (xxx);
  4. $zapytanie = "SELECT branche2 FROM user WHERE branche2 LIKE 'B%' GROUP BY branche2 having count(*) > 1";
  5. $wykonaj = mysql_query ($zapytanie);
  6. while($wiersz=mysql_fetch_array ($wykonaj)) {
  7. echo "<a href=\"#\" onclick=\"window.open('pbranche.php?branche2=".$wiersz['branche2']."', 'new', 'height=200,width=500');\">".$wiersz['branche2']."</a> ";
  8. }
  9. ?>


Plik : pbranche.php
  1. <?php
  2. mysql_connect ("localhost","xxx","xxx");
  3. mysql_select_db (xxx);
  4. $zapytanie = "SELECT id, firma, inhaber, branche2 FROM user WHERE branche2= " . $_GET['branche2'] . " ";
  5. $wykonaj = mysql_query ($zapytanie);
  6. while($wiersz=mysql_fetch_array ($wykonaj)) {
  7. echo ".....";
  8. }
  9. ?>


Pokazuje mi sie blad zapytania przy otwieraniu pliku pbranche.php.... Wie ktos, co moze byc przyczyna?
Go to the top of the page
+Quote Post
dr_bonzo
post
Post #2





Grupa: Przyjaciele php.pl
Postów: 5 724
Pomógł: 259
Dołączył: 13.04.2004
Skąd: N/A

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


1. ktore to zapytanie?
2. podaj tresc bledu
Go to the top of the page
+Quote Post
sparky87
post
Post #3





Grupa: Zarejestrowani
Postów: 15
Pomógł: 0
Dołączył: 5.08.2006

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


aaa..sory zapomnialem (IMG:http://forum.php.pl/style_emoticons/default/tongue.gif) ...

Treść błedu w pliku pbranche.php :
"Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /last/pbranche.php on line 17"
Go to the top of the page
+Quote Post
SongoQ
post
Post #4





Grupa: Przyjaciele php.pl
Postów: 2 923
Pomógł: 9
Dołączył: 25.10.2004
Skąd: Rzeszów - studia / Warszawa - praca

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


  1. <?php
  2. $zapytanie = "SELECT id, firma, inhaber, branche2 FROM user WHERE branche2= '" . $_GET['branche2'] . "' ";
  3. ?>
Go to the top of the page
+Quote Post
sparky87
post
Post #5





Grupa: Zarejestrowani
Postów: 15
Pomógł: 0
Dołączył: 5.08.2006

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


Dziala..Dzieki Bardzo (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)
Go to the top of the page
+Quote Post

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: 19.12.2025 - 03:54