![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 17 Pomógł: 0 Dołączył: 21.04.2003 Ostrzeżenie: (0%) ![]() ![]() |
[php:1:ae4ca6314d]
<? include( "config.php" ); $zapytanie = "SELECT id, autor, email, tytul, tresc, data"; $wynik = mysql_query( $zapytanie ); while( $wiersz = mysql_fetch_array( $wynik )) { $id = $wiersz['id']; $autor = $wiersz['autor']; $email = $wiersz['email']; $tytul = $wiersz['tytul']; $tresc = $wiersz['tresc']; $data = $wiersz['data']; echo "Tytuł: $tytul.<BR>"; echo "$tresc<BR"; echo "Autor: <A HREF="mailto:$email">$autor</A>"; } ?> [/php:1:ae4ca6314d] Mam taki kod i wystkuje mi taki błąd Cytat Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in c:usrkrasnalwwwnewsyodczyt.php on line 7
Wie ktoś jak się tego pozbyć? (IMG:http://forum.php.pl/style_emoticons/default/sad.gif) |
|
|
![]() |
![]()
Post
#2
|
|
Grupa: Zarejestrowani Postów: 17 Pomógł: 0 Dołączył: 21.04.2003 Ostrzeżenie: (0%) ![]() ![]() |
[sql:1:78f2956b23]
CREATE TABLE `newsy` ( `numer` int(11) NOT NULL auto_increment, `autor` text NOT NULL, `email` text NOT NULL, `data` date NOT NULL default '0000-00-00', `temat` text NOT NULL, `tresc` text NOT NULL, UNIQUE KEY `numer` (`numer`) ) TYPE=MyISAM AUTO_INCREMENT=8 ; [/sql:1:78f2956b23] A kod pliku [php:1:78f2956b23] <? include ("config.php"); $zapytanie = mysql_query ("SELECT n.numer, n.autor, email, n.data, n.temat, n.tresc FROM ".$dbname. "AS n ORDER BY n.numer DESC"); while ($rekord = mysql_fetch_array ($zapytanie)) { $numer = $rekord['numer']; $autor = $rekord['autor']; $email = $rekord['data']; $temat = $rekord['temat']; $tresc = $rekord['tresc']; echo $rekord['autor']."<BR><BR>".$rekord['email']."<BR><BR>".$rekord['data']."<BR><BR>".$rekord['temat']."<BR><BR>".$rekord['tresc']; } ?> [/php:1:78f2956b23] I błąd jest w linii z mysql_fetch_array. |
|
|
![]() ![]() |
![]() |
Aktualny czas: 16.10.2025 - 07:18 |