phpbar.de logo

Mailinglisten-Archive

[php] =?iso-8859-1?Q?leere_tabelle_pr=FCfen?=

[php] =?iso-8859-1?Q?leere_tabelle_pr=FCfen?=

sandro pilch sapi2_(at)_yahoo.de
Mon, 27 Mar 2000 14:19:39 +0200


This is a multi-part message in MIME format.

------=_NextPart_000_0009_01BF97F7.7CA704A0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

hi

ich wollte =FCberpr=FCfen, ob eine tabelle daten enth=E4lt
oder nicht.=20
wenn die tabelle nicht leer ist wir ganz normal die=20
else anweisung ausgef=FChrt. wenn sie leer ist=20
stoppt die ausgabe vor oder bei der if anweisung.
es wird also weder if noch else noch der html body
ausgegeben.

mit folgendem code hab ich es probiert:

 $query =3D "select * from products order by name";
 $result =3D mysql_db_query($database, $query);
 $num =3D mysql_numrows($result) or die(mysql_error());

 if ($num =3D=3D 0)
 {
  echo "No data found in the database";
 }

else
{
.....
}

 echo "</body>";
 echo "</html>";


danke schon mal
sandro pilch

p.s. sorry, das ich in meinem urlencode posting so=20
ungeduldig war und nach ein paar stunden nochmals=20
nachgefragt habe!

------=_NextPart_000_0009_01BF97F7.7CA704A0
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 content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2614.3500" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>hi</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>ich wollte =FCberpr=FCfen, ob eine =
tabelle daten=20
enth=E4lt</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>oder nicht. </FONT></DIV>
<DIV><FONT face=3DArial size=3D2>wenn die tabelle nicht leer ist wir =
ganz normal die=20
</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>else anweisung ausgef=FChrt. wenn sie =
leer ist=20
</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>stoppt die ausgabe vor oder bei der if=20
anweisung.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>es wird also weder if noch else noch =
der html=20
body</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>ausgegeben.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>mit folgendem code hab ich es=20
probiert:</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;$query =3D "select * from =
products order by=20
name";<BR>&nbsp;$result =3D mysql_db_query($database, =
$query);<BR>&nbsp;$num =3D=20
mysql_numrows($result) or die(mysql_error());</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;if ($num =3D=3D =
0)<BR>&nbsp;{<BR>&nbsp;&nbsp;echo=20
"No data found in the database";<BR>&nbsp;}</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>else</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>{</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>.....</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>}</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;echo =
"&lt;/body&gt;";<BR>&nbsp;echo=20
"&lt;/html&gt;";</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>danke schon mal</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>sandro pilch</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>p.s. sorry, das ich in meinem urlencode =
posting so=20
</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>ungeduldig war und nach ein paar =
stunden nochmals=20
</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>nachgefragt =
habe!</FONT></DIV></BODY></HTML>

------=_NextPart_000_0009_01BF97F7.7CA704A0--


__________________________________________________________________
Do You Yahoo!?
Gesendet von Yahoo! Mail - http://mail.yahoo.de
Yahoo! Auktionen - gleich ausprobieren - http://auktionen.yahoo.de



php::bar PHP Wiki   -   Listenarchive