Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [php][mysql] Logowanie problem
icetab
post
Post #1





Grupa: Zarejestrowani
Postów: 226
Pomógł: 3
Dołączył: 3.04.2007

Ostrzeżenie: (50%)
XXX--


Mam problem robie logowanie i mam blad a nie wiem gdzie dokladnie
blad
Kod
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in login.php on line 30


  1. <?php
  2. $ilosc=mysql_fetch_assoc(mysql_query("select count(id) from `admin` where `login`='$login' and `haslo`='$haslo'"));
  3. ?>


Ten post edytował icetab 12.04.2008, 22:33:43
Go to the top of the page
+Quote Post
--lilik--
post
Post #2





Goście







Wdaje mi sie ze cos takiego wyswietla dla tego ze tabela admin nie istnieje
Go to the top of the page
+Quote Post
pyro
post
Post #3





Grupa: Zarejestrowani
Postów: 2 148
Pomógł: 230
Dołączył: 26.03.2008

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


Cytat(-lilik- @ 12.04.2008, 23:47:22 ) *
Wdaje mi sie ze cos takiego wyswietla dla tego ze tabela admin nie istnieje


źle ci się wydaje tongue.gif blad by byl "table 'admin' doesn't exist'

spróbuj coś takiego:

  1. <?php
  2. $ilosc=mysql_fetch_assoc(mysql_query("select count(id) from admin where login = '$login' and haslo = '$haslo'"));
  3. ?>


--------------------
ET LINGUA EIUS LOQUETUR IUDICIUM
Go to the top of the page
+Quote Post
tieria
post
Post #4





Grupa: Zarejestrowani
Postów: 2
Pomógł: 0
Dołączył: 12.04.2008

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


proponuje tak:
Kod
<?php
$ilosc=mysql_fetch_assoc(mysql_query("select count(id) from `admin` where `login` = '".$login."' and `haslo` = '".$haslo."'"));
?>


Ten post edytował tieria 13.04.2008, 11:58:54
Go to the top of the page
+Quote Post
--lilik--
post
Post #5





Goście







Cytat(pyro @ 13.04.2008, 10:00:31 ) *
źle ci się wydaje tongue.gif blad by byl "table 'admin' doesn't exist'


no wlasnie nie zle, bo mialem taka sytuacje ze jak istaniala tabela nawet pusta to bylo ok a kiedy tabela nie istniala bo np zrobilem literoke to wyswietlalo mi dokladnie tak isam blod
Go to the top of the page
+Quote Post
pyro
post
Post #6





Grupa: Zarejestrowani
Postów: 2 148
Pomógł: 230
Dołączył: 26.03.2008

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


Cytat(-lilik- @ 13.04.2008, 13:58:30 ) *
no wlasnie nie zle, bo mialem taka sytuacje ze jak istaniala tabela nawet pusta to bylo ok a kiedy tabela nie istniala bo np zrobilem literoke to wyswietlalo mi dokladnie tak isam blod


  1. mysql> USE test;
  2. DATABASE changed
  3. mysql> SELECT * FROM sdasdsda
  4. -> ;
  5. ERROR 1146 (42S02): TABLE 'test.sdasdsda' doesn't exist
  6. mysql>


--------------------
ET LINGUA EIUS LOQUETUR IUDICIUM
Go to the top of the page
+Quote Post
likedat
post
Post #7





Grupa: Zarejestrowani
Postów: 20
Pomógł: 1
Dołączył: 1.03.2008

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


Może to głupie, ale łączysz się z tą bazą gdzieś wyżej? Jeśli tak, to sprawdz mysql_error(), czy połączenie zostało nawiązane [;
Go to the top of the page
+Quote Post

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

 



RSS Aktualny czas: 21.08.2025 - 07:39