php.de

Zurück   php.de > Webentwicklung > PHP Einsteiger > PHP Tipps 2004

 
 
LinkBack Themen-Optionen Thema bewerten
Alt 06.09.2004, 20:59  
Gast
 
Beiträge: n/a
Standard Warning: mysql_num_rows(): supplied argument is not a valid

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /script2.php on line 32

PHP-Code:
//Auslesen der Daten
$tabelle="guestbook";
$sql="SELECT * FROM $tabelle ORDER BY datum DESC";
$link = mysql_connect("localhost", "web611", 310978);
mysql_select_db("usr_web611_4", $link);     
$result = mysql_query($sql, $link);
//zeile 32
for($i=0;$i<mysql_num_rows($result);$i++)
{
$ergebnis[$i]=mysql_fetch_array($result);
}
?>
<html>
<head>
<title>Unbenanntes Dokument</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<?php
//Ausgeben der Daten
for($i=0;$i<count($ergebnis);$i++)
{
echo 
"table border\"1\" width\"400\"><tr><td>
was ist an diesem code falsch??

danke für eure antwort
 
Sponsor Mitteilung
PHP Code Flüsterer

Registriert seit: 21.08.2005
Beiträge: 4682
PHP-Kenntnisse:
Fortgeschritten

Alt 06.09.2004, 21:11  
Gast
 
Beiträge: n/a
Standard

verwende doch mysql_error()
außerdem eignet sich while herforagend zum anzeigen von mysql daten :wink:
PHP-Code:
<?php 
 
# zur datenbank verbinden
$tabelle="guestbook"
$sql="SELECT * FROM $tabelle ORDER BY datum DESC";  Â*Â*Â*Â* 
$result 
mysql_query($sql)or die(mysql_error().'
'
.$sql); 
while(
$Obj=mysql_fetch_object($result))
  {
    
// daten ausgeben zB:
     
echo $Obj->name.'
'
;
  }
?>
mysql_fetch_object()
 
Alt 06.09.2004, 21:26  
Erfahrener Benutzer
 
Registriert seit: 18.09.2003
Beiträge: 13.598
PHP-Kenntnisse:
Fortgeschritten
imported_Ben ist zur Zeit noch ein unbeschriebenes Blatt
Standard

16.14. Warum soll ich nicht SELECT * schreiben?
http://www.dclp-faq.de/q/q-sql-select.html

28.4. Supplied argument is not a valid MySQL result...
http://www.dclp-faq.de/q/q-fehler-mysql-result.html
imported_Ben ist offline  
 


Themen-Optionen
Thema bewerten
Thema bewerten:

Forumregeln
Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are an
Gehe zu

Ähnliche Themen
Thema Autor Forum Antworten Letzter Beitrag
[Erledigt] PHP -&gt; Ordner anlegen der sich auch beschreiben lässt?! Nightuser PHP Tipps 2008 13 30.06.2008 23:51
Warning: fread(): supplied argument is not a valid stream resource... pixelprinzessin PHP Tipps 2008 20 23.04.2008 15:44
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource Zabimaru PHP Tipps 2008 7 02.04.2008 13:25
Warning: fwrite(): supplied argument is not a valid stream Venom PHP Tipps 2007 27 15.12.2005 18:14
mysql_result(): supplied argument is not a valid MySQL PHP Tipps 2005-2 4 25.08.2005 14:44
kleines problem mit fwrite Tic Rederon PHP Tipps 2005-2 6 23.08.2005 08:24
Suche Tipps für Persormance-Steigerung (Geld für Nützliches) Beitragsarchiv 18 16.08.2005 10:57
[Erledigt] Warning: mysql_num_fields(): supplied argument is not a... Datenbanken 18 09.06.2005 21:03
ShowIt_V1.8.14 PHP Tipps 2005 1 23.03.2005 19:13
frage zum arbeiten mit dateien PHP Tipps 2005 21 01.03.2005 13:22
Warning: mysql_result(): supplied argument is not a valid My Soese Datenbanken 6 27.01.2005 09:47
wieder einmal : Warning: mysql_num_rows(): supplied argument nieselfriem PHP Tipps 2004-2 8 29.11.2004 13:30
Counter zeigt nach ca. 2-3 Stunden fehler an PHP Tipps 2004 2 26.08.2004 20:08
mysql_fetch_row(): supplied argument is not a valid MySQL re PHP Tipps 2004 10 30.06.2004 10:17
Warning: mysql_num_rows(): supplied argument is not a valid PHP Tipps 2004 1 15.06.2004 15:54

Besucher kamen über folgende Suchanfragen bei Google auf diese Seite
php warning: mysql_num_rows(): supplied argument is not a valid mysql result resource in, warning: mysql_num_rows(): supplied argument is not a valid mys, mysql_num_rows(): supplied argument is not a valid mys, mysql_num_rows(): supplied argument is not a valid, warning: mysql_num_rows(): supplied argument is not a valid mysql, php warnung mysql_num_rows, mysql_num_rows iso, mysql_num_rows() obj, supplied argument is not a valid mysql result resource

Alle Zeitangaben in WEZ +2. Es ist jetzt 02:50 Uhr.




Powered by vBulletin® Version 3.7.2 (Deutsch)
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
Aprilia-Forum, Aquaristik-Forum, Liebeskummer-Forum, Zierfisch-Forum, Geizkragen-Forum

Creative Commons License
Dieser Inhalt ist unter einer Creative Commons-Lizenz lizenziert.