
A więc swoja przygodę z php zaczynam od kursu "Tutorial PHP /MySQL". Tam doszedłem do wyświetlania zawartości bazy danych i poległem

Kod
<?
$username="nazwa użtkownika";
$password="chasło użytkownika";
$database="nazwa bazy danych";
[url="http://www.php.net/mysql_connect"]mysql_connect[/url]('localhost',$username,$password);
@[url="http://www.php.net/mysql_select_db"]mysql_select_db[/url]($database) or [url="http://www.php.net/die"]die[/url]("Nie odnaleziono bazy danych");
$query="SELECT * FROM contacts";
$result=[url="http://www.php.net/mysql_query"]mysql_query[/url]($query);
$num=[url="http://www.php.net/mysql_numrows"]mysql_numrows[/url]($result);
[url="http://www.php.net/mysql_close"]mysql_close[/url]();
[url="http://www.php.net/echo"]echo[/url] "<b><center>Struktura bazy danych</center></b><br><br>";
$i=0;
while ($i < $num) {
$first=[url="http://www.php.net/mysql_result"]mysql_result[/url]($result,$i,"first");
$last=[url="http://www.php.net/mysql_result"]mysql_result[/url]($result,$i,"last");
$phone=[url="http://www.php.net/mysql_result"]mysql_result[/url]($result,$i,"phone");
$mobile=[url="http://www.php.net/mysql_result"]mysql_result[/url]($result,$i,"mobile");
$fax=[url="http://www.php.net/mysql_result"]mysql_result[/url]($result,$i,"fax");
$email=[url="http://www.php.net/mysql_result"]mysql_result[/url]($result,$i,"email");
$web=[url="http://www.php.net/mysql_result"]mysql_result[/url]($result,$i,"web");
[url="http://www.php.net/echo"]echo[/url] "<b>$first $last</b><br>telefon stacjonarny: $phone<br>Telefon komórkowy: $mobile<br>Fax: $fax<br>E-mail: $email<br>Strona WWW: $web<br><hr><br>";
$i++;
}
?>
$username="nazwa użtkownika";
$password="chasło użytkownika";
$database="nazwa bazy danych";
[url="http://www.php.net/mysql_connect"]mysql_connect[/url]('localhost',$username,$password);
@[url="http://www.php.net/mysql_select_db"]mysql_select_db[/url]($database) or [url="http://www.php.net/die"]die[/url]("Nie odnaleziono bazy danych");
$query="SELECT * FROM contacts";
$result=[url="http://www.php.net/mysql_query"]mysql_query[/url]($query);
$num=[url="http://www.php.net/mysql_numrows"]mysql_numrows[/url]($result);
[url="http://www.php.net/mysql_close"]mysql_close[/url]();
[url="http://www.php.net/echo"]echo[/url] "<b><center>Struktura bazy danych</center></b><br><br>";
$i=0;
while ($i < $num) {
$first=[url="http://www.php.net/mysql_result"]mysql_result[/url]($result,$i,"first");
$last=[url="http://www.php.net/mysql_result"]mysql_result[/url]($result,$i,"last");
$phone=[url="http://www.php.net/mysql_result"]mysql_result[/url]($result,$i,"phone");
$mobile=[url="http://www.php.net/mysql_result"]mysql_result[/url]($result,$i,"mobile");
$fax=[url="http://www.php.net/mysql_result"]mysql_result[/url]($result,$i,"fax");
$email=[url="http://www.php.net/mysql_result"]mysql_result[/url]($result,$i,"email");
$web=[url="http://www.php.net/mysql_result"]mysql_result[/url]($result,$i,"web");
[url="http://www.php.net/echo"]echo[/url] "<b>$first $last</b><br>telefon stacjonarny: $phone<br>Telefon komórkowy: $mobile<br>Fax: $fax<br>E-mail: $email<br>Strona WWW: $web<br><hr><br>";
$i++;
}
?>
Ja wszystko skopiowałem (zmieniłem tylko wymagane pola takie jak haslo itp.). Wrzuciłem to na serwer i odpaliłem. Wtedy pojawił mi sie taki o to bład: "Warning: mysql_numrows(): supplied argument is not a valid MySQL result resource in /var/www/sites/yoyo.pl/h/i/historia-sciaga/wyswietl.php on line 12".
Czy jest ktoś w stanie pomóc??
---
Link do tutorialu: http://wortal.php.pl/phppl/wortal/artykuly...anie_informacji
MySQL na serwerze: 5.0.51a
Php na serwerze: PHP4 jest w wersji 4.4.4 PHP5 jest w wersji 5.1.2
Z góry dziękuje za pomoc

@edit1
Sorry ale wstawiłem nie ten kod. Już poprawiłem.