Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP][MYSQL]Blad funkcji mysql_fetch_row
qwertY1234
post
Post #1





Grupa: Zarejestrowani
Postów: 6
Pomógł: 0
Dołączył: 27.05.2008

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


Witam,

Mam problem z Mysql/php. Mam skrypt prostego logowania:
Kod
<?php

$user = $_POST['user'];
$pass = $_POST['pass'];

if (empty($user) && empty($pass))
{
    echo 'Wypelnij wszystkie pola!';
}

else
{
   $mysql =  mysql_connect('localhost','uwierzytel','uwierzytel')
    
    or die ('Brak poloczenia.<br />Blad"'.mysql_error());
    
    $db = mysql_select_db('login',$mysql);
    
      $wynik = mysql_query("select count(*) from user where uzytkownik=='$uzytkownik' and haslo==sha1('$haslo')");

    
    $wiersz = mysql_fetch_row($wynik);
$ile = $wiersz[0];
    
    if ($ile > 0)
    {
        echo 'zalogowany';
          }
    else     {
    echo 'blad';
     }
}
  ?>


ale pojawia sie blad:
Kod
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in C:\Program Files\WebServ\httpd-users\now\s\login.php on line 23
blad
Co jest zle?

Ten post edytował qwertY1234 27.05.2008, 13:27:12
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: 14.09.2025 - 21:57