Mailinglisten-Archive |
This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------ =_NextPart_001_01C0C25F.2630C0F0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hallo, ich habe folgendes Problem: Ich versuche auf eine mySQl-Datenbank zuzugreifen. Dies ist der Quelltext meiner Abfrage: <html><body><div align=3D"center"> <? $db =3D mysql_connect("localhost","root"); mysql_select_db("mailconfig",$db); $result =3D mysql_query("SELECT * FROM kunden",$db); ?> <table border=3D"1" cellspacing=3D"0" cellpadding=3D"3" = align=3D"center"> <tr> <td><b>ID</b></td> <td><b>Name</b></td> <td><b>Firma</b></td> <td><b>Herr/Frau</b></td> <td><b>e-mail</b></td> <td><b>Tel</b></td> <td><b>Strasse</b></td> <td><b>Handy</b></td> <td><b>PLZ</b></td> <td><b>Ort</b></td> </tr> <? while ($daten =3D mysql_fetch_array($result)) { ?> <tr> <td><? echo $daten[KID]; ?></td> <td><? echo $daten[name]; ?></td> <td><? echo $daten[firma]; ?></td> <td><? echo $daten[anrede]; ?></td> <td><? echo '<a = href=3D"mailto:'.$daten[email].'">'.$daten[email].'</a>'; ?></td> <td><? echo $daten[tel]; ?></td> <td><? echo $daten[strasse]; ?></td> <td><? echo $daten[mobil]; ?></td> <td><? echo $daten[plz]; ?></td> <td><? echo $daten[ort]; ?></td> </tr> <? } ?> </table></div></body></html> Doch dann kommt folgende Ausgabe: Warning: Supplied argument is not a valid MySQL result resource in /customer/websites/mailconfig/htdocs/dev/uebersicht.php on line 25 Also hier:=20 <? while ($daten =3D mysql_fetch_array($result)) { ?>=20 macht er Probleme. Woran mags liegen? W=FCrde mich =FCber eine Antwort freuen. Mit freundlichen Gr=FC=DFen Tobias Pusch ------ =_NextPart_001_01C0C25F.2630C0F0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; = charset=3Diso-8859-1"> <META content=3D"MSHTML 5.00.2920.0" name=3DGENERATOR></HEAD> <BODY> <DIV> <P><FONT face=3DVerdana size=3D2>Hallo,</FONT></P> <P><FONT face=3DVerdana size=3D2>ich habe folgendes = Problem:</FONT><FONT=20 face=3DVerdana size=3D2><BR>Ich versuche auf eine mySQl-Datenbank = zuzugreifen. Dies=20 ist der Quelltext meiner Abfrage:</FONT></P> <P><FONT face=3DVerdana size=3D2><html><body><div=20 align=3D"center"><BR></FONT><FONT face=3DVerdana = size=3D2><?<BR></FONT><FONT=20 face=3DVerdana size=3D2></FONT></P> <P><FONT face=3DVerdana size=3D2>$db =3D=20 mysql_connect("localhost","root");<BR></FONT><FONT face=3DVerdana=20 size=3D2>mysql_select_db("mailconfig",$db);<BR></FONT><FONT = face=3DVerdana=20 size=3D2>$result =3D mysql_query("SELECT * FROM = kunden",$db);</FONT></P> <P><FONT face=3DVerdana size=3D2>?></FONT></P> <P><FONT face=3DVerdana size=3D2><table border=3D"1" = cellspacing=3D"0"=20 cellpadding=3D"3" align=3D"center"><BR></FONT><FONT face=3DVerdana=20 size=3D2><tr><BR></FONT><FONT face=3DVerdana=20 size=3D2><td><b>ID</b></td><BR></FONT><FONT = face=3DVerdana=20 size=3D2><td><b>Name</b></td><BR></FONT><FONT = face=3DVerdana=20 size=3D2><td><b>Firma</b></td><BR></FONT><FONT=20 face=3DVerdana=20 size=3D2><td><b>Herr/Frau</b></td><BR></FONT><FO= NT=20 face=3DVerdana=20 size=3D2><td><b>e-mail</b></td><BR></FONT><FONT = face=3DVerdana = size=3D2><td><b>Tel</b></td><BR></FONT><FONT=20 face=3DVerdana=20 size=3D2><td><b>Strasse</b></td><BR></FONT><FONT= =20 face=3DVerdana=20 size=3D2><td><b>Handy</b></td><BR></FONT><FONT=20 face=3DVerdana = size=3D2><td><b>PLZ</b></td><BR></FONT><FONT=20 face=3DVerdana = size=3D2><td><b>Ort</b></td><BR></FONT><FONT=20 face=3DVerdana size=3D2></tr></FONT></P> <P><FONT face=3DVerdana size=3D2><? while ($daten =3D = mysql_fetch_array($result)) {=20 ?></FONT></P> <P><FONT face=3DVerdana size=3D2><tr><BR></FONT><FONT = face=3DVerdana=20 size=3D2><td><? echo $daten[KID]; = ?></td><BR></FONT><FONT=20 face=3DVerdana size=3D2><td><? echo $daten[name];=20 ?></td><BR></FONT><FONT face=3DVerdana = size=3D2><td><? echo=20 $daten[firma]; ?></td><BR></FONT><FONT face=3DVerdana=20 size=3D2><td><? echo $daten[anrede]; ?></td><BR><SPAN = class=3D697120708-11042001><</SPAN>td><? echo '<a=20 href=3D"mailto:'.$daten[email].'">'.$daten[email].'</a>';=20 ?></td></FONT><FONT face=3DVerdana = size=3D2><BR><td><? echo=20 $daten[tel]; ?></td></FONT><FONT face=3DVerdana=20 size=3D2><BR><td><? echo $daten[strasse];=20 ?></td><BR></FONT><FONT face=3DVerdana = size=3D2><td><? echo=20 $daten[mobil]; ?></td><BR></FONT><FONT face=3DVerdana=20 size=3D2><td><? echo $daten[plz]; = ?></td><BR></FONT><FONT=20 face=3DVerdana size=3D2><td><? echo $daten[ort];=20 ?></td></FONT><FONT face=3DVerdana = size=3D2><BR></tr></FONT></P> <P><FONT face=3DVerdana size=3D2><? } ?></FONT></P> <P><FONT face=3DVerdana=20 size=3D2></table></div></body></html></FONT></P>= <P><FONT face=3DVerdana size=3D2>Doch dann kommt folgende = Ausgabe:</FONT></P> <P><FONT face=3DVerdana size=3D2>Warning: Supplied argument is not a = valid MySQL=20 result resource in = /customer/websites/mailconfig/htdocs/dev/uebersicht.php on=20 line 25</FONT></P> <P><FONT face=3DArial><SPAN class=3D697120708-11042001><FONT = size=3D2>Also hier:=20 </FONT></P> <P><FONT size=3D2><FONT face=3DVerdana><? while ($daten =3D=20 mysql_fetch_array($result)) { ?><SPAN class=3D697120708-11042001>=20 </SPAN></FONT></FONT></P> <P><FONT size=3D2><FONT face=3DVerdana><SPAN = class=3D697120708-11042001>macht er=20 Probleme.</SPAN></FONT></FONT></P></SPAN></FONT> <P><FONT face=3DVerdana size=3D2>Woran mags liegen?</FONT></P> <P><FONT face=3DVerdana size=3D2>W=FCrde mich =FCber eine Antwort = freuen.</FONT></P> <P><FONT face=3DVerdana size=3D2>Mit freundlichen Gr=FC=DFen</FONT></P> <P><FONT face=3DVerdana size=3D2>Tobias = Pusch</FONT></P></DIV></BODY></HTML> ------ =_NextPart_001_01C0C25F.2630C0F0--
php::bar PHP Wiki - Listenarchive