Mailinglisten-Archive |
This is a multi-part message in MIME format.
------=_NextPart_000_0061_01BF5864.93A98EC0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Danke Danke Danke,
so schnell die Antwort und es funktioniert ;>!!!!
danke
juhu
greets,
Tobias
----- Original Message -----=20
From: Christoph Aigner=20
To: php_(at)_solix.wiso.Uni-Koeln.DE=20
Sent: Thursday, January 06, 2000 4:29 PM
Subject: Re: [php] Hilfe
hallo,
1.du hast einen programmierfehler in deinem script, da du die while =
schleife gleich nach der variablenzuweisung schliesst, wird nur der =
letzte datensatz ausgegeben
2.ganz einfach:
nach $download =3D $files[4]; schreibe einfach
if ($download =3D=3D "") $download =3D "N/A";
lg Christoph Aigner
---------------------------------------------------------
Christoph Aigner
Alaris Informationsmanagement
A-1160 Vienna, Weinheimergasse 8
Tel: +43-1-4860210
Fax: +43-1-4863445
eMail: christoph_(at)_alaris.at
Internet: www.alaris.at
----- Original Message -----=20
From: Tobias Kuhrmann=20
To: php_(at)_solix.wiso.Uni-Koeln.DE=20
Sent: Thursday, January 06, 2000 4:24 PM
Subject: [php] Hilfe
Hallo,
ich habe folgendes Problem:
Ich habe f=FCr meine Webseite eine Datenbankauslesung gemacht, so =
das mehrere Spiele in einer Liste angezeigt werden (table). Nun ist mir =
der Gedanke hinzugekommen doch noch die M=F6glichkeit einzubauen, einen =
Download anzubieten. Nun das Problem:
Die ganze Liste wird durch den print befehl geschrieben und nicht zu =
jedem Spiel habe ich einen Download. Ich m=F6chte also das wenn in der =
Datenbankspalte keine Pfad angegeben ist, er in der Tabelle den Text =
"n/a" anzeigt. Hier eine kleine Kopie:
<?
require("../php/dblogonHalflifeweb.php3");
mysql_connect("$dbHost","$dbUser","$dbPassword");
mysql_select_db("$dbName");
$file =3D mysql_query("SELECT * FROM mods order by name");
while ($files =3D mysql_fetch_row($file))
{
$released =3D $files[1];
$name =3D $files[2];
$url =3D $files[3];
$download =3D $files[4];
}
print ("
<tr>
<td nowrap>
<center><font color=3D#FFFFFF size=3D1 face=3DVerdana>$released
</td>
<td nowrap>
<center><font color=3D#FFFFFF size=3D1 face=3DVerdana>$download
</td>
<td nowrap>
<font color=3D#FFFFFF size=3D1 face=3DVerdana>$name
</td>
<td nowrap>
<font size=3D1 color=3D#FFFFFF face=3DVerdana><a href=3D$url =
target=3Dnew>$url</a>
</td>
</tr>
");
}
print ("</table>");
mysql_close();
?></ul>
An der Stelle bei "$downlod" soll nun WENN in der Datenbank eine URL =
angegeben ist, der Pfad angezeigt werden, wenn der Table in der =
Datenbank jedoch leer ist, m=F6chte ich ein n/a da haben. Was kann ich =
tun, ich bitte um rat.
MfG.,
Ripley aka Tobias Kuhrmann
------=_NextPart_000_0061_01BF5864.93A98EC0
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.2919.6307" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Danke Danke Danke,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>so schnell die Antwort und es =
funktioniert=20
;>!!!!</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> danke</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>juhu</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>greets,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Tobias</FONT></DIV>
<BLOCKQUOTE=20
style=3D"BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: =
0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px">
<DIV style=3D"FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV=20
style=3D"BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: =
black"><B>From:</B>=20
<A href=3D"mailto:christoph_(at)_alaris.at" =
title=3Dchristoph_(at)_alaris.at>Christoph=20
Aigner</A> </DIV>
<DIV style=3D"FONT: 10pt arial"><B>To:</B> <A=20
href=3D"mailto:php_(at)_solix.wiso.Uni-Koeln.DE"=20
title=3Dphp_(at)_solix.wiso.Uni-Koeln.DE>php_(at)_solix.wiso.Uni-Koeln.DE</A> =
</DIV>
<DIV style=3D"FONT: 10pt arial"><B>Sent:</B> Thursday, January 06, =
2000 4:29=20
PM</DIV>
<DIV style=3D"FONT: 10pt arial"><B>Subject:</B> Re: [php] Hilfe</DIV>
<DIV><BR></DIV>
<DIV><FONT face=3DArial size=3D2>hallo,</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>1.du hast einen programmierfehler in =
deinem=20
script, da du die while schleife gleich nach der variablenzuweisung =
schliesst,=20
wird nur der letzte datensatz ausgegeben</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>2.ganz einfach:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>nach $download =3D $files[4]; =
schreibe=20
einfach</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>if (</FONT><FONT face=3DArial =
size=3D2>$download =3D=3D=20
"") $download =3D "N/A";</FONT></DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>lg Christoph Aigner</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial=20
=
size=3D2>---------------------------------------------------------<BR>Chr=
istoph=20
Aigner<BR>Alaris Informationsmanagement<BR>A-1160 Vienna, =
Weinheimergasse=20
8<BR>Tel: +43-1-4860210<BR>Fax: +43-1-4863445<BR>eMail: <A=20
=
href=3D"mailto:christoph_(at)_alaris.at">christoph_(at)_alaris.at</A><BR>Internet: =
<A=20
href=3D"http://www.alaris.at">www.alaris.at</A></FONT></DIV>
<DIV> </DIV>
<BLOCKQUOTE=20
style=3D"BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; =
MARGIN-RIGHT: 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px">
<DIV style=3D"FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV=20
style=3D"BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: =
black"><B>From:</B>=20
<A href=3D"mailto:admin_(at)_hlweb.de" title=3Dadmin_(at)_hlweb.de>Tobias =
Kuhrmann</A>=20
</DIV>
<DIV style=3D"FONT: 10pt arial"><B>To:</B> <A=20
href=3D"mailto:php_(at)_solix.wiso.Uni-Koeln.DE"=20
title=3Dphp_(at)_solix.wiso.Uni-Koeln.DE>php_(at)_solix.wiso.Uni-Koeln.DE</A> =
</DIV>
<DIV style=3D"FONT: 10pt arial"><B>Sent:</B> Thursday, January 06, =
2000 4:24=20
PM</DIV>
<DIV style=3D"FONT: 10pt arial"><B>Subject:</B> [php] Hilfe</DIV>
<DIV><BR></DIV>
<DIV><FONT face=3DArial size=3D2>Hallo,</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>ich habe folgendes =
Problem:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Ich habe f=FCr meine Webseite eine=20
Datenbankauslesung gemacht, so das mehrere Spiele in einer Liste =
angezeigt=20
werden (table). Nun ist mir der Gedanke hinzugekommen doch noch die=20
M=F6glichkeit einzubauen, einen Download anzubieten. Nun das=20
Problem:</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>Die ganze Liste wird durch den =
print befehl=20
geschrieben und nicht zu jedem Spiel habe ich einen Download. Ich =
m=F6chte=20
also das wenn in der Datenbankspalte keine Pfad angegeben ist, er in =
der=20
Tabelle den Text "n/a" anzeigt. Hier eine kleine Kopie:</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial=20
=
size=3D2><?<BR> require("../php/dblogonHalflifeweb.php3");<BR>&nb=
sp;mysql_connect("$dbHost","$dbUser","$dbPassword");<BR> mysql_selec=
t_db("$dbName");<BR> $file=20
=3D mysql_query("SELECT * FROM mods order by name");<BR> while =
($files =3D=20
=
mysql_fetch_row($file))<BR> {<BR> $released =
=3D=20
$files[1];<BR> $name =3D =
$files[2];<BR> $url=20
=3D $files[3];<BR> $download =3D =
$files[4];</FONT></DIV>
<DIV><FONT face=3DArial =
size=3D2> }<BR> print=20
("<BR><tr><BR> <td =
nowrap><BR> <center><font=20
color=3D#FFFFFF size=3D1=20
face=3DVerdana>$released<BR> </td><BR> <td=20
nowrap><BR> <center><font color=3D#FFFFFF size=3D1=20
face=3DVerdana>$download<BR> </td><BR> <td=20
nowrap><BR> <font color=3D#FFFFFF size=3D1=20
face=3DVerdana>$name<BR> </td><BR> <td=20
nowrap><BR> <font size=3D1 color=3D#FFFFFF =
face=3DVerdana><a=20
href=3D$url=20
=
target=3Dnew>$url</a><BR> </td><BR></tr><BR>");=
<BR> }<BR> print=20
=
("</table>");<BR> mysql_close();<BR>?></ul></FONT></D=
IV>
<DIV> </DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>An der Stelle bei "$downlod" soll =
nun WENN in=20
der Datenbank eine URL angegeben ist, der Pfad angezeigt werden, =
wenn der=20
Table in der Datenbank jedoch leer ist, m=F6chte ich ein n/a da =
haben. Was=20
kann ich tun, ich bitte um rat.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>MfG.,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Ripley aka Tobias=20
Kuhrmann</FONT></DIV></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>
------=_NextPart_000_0061_01BF5864.93A98EC0--
php::bar PHP Wiki - Listenarchive