Mailinglisten-Archive |
This is a multi-part message in MIME format.
------=_NextPart_000_0044_01BF5862.787F2120
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
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_0044_01BF5862.787F2120
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>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 =
Datenbankauslesung=20
gemacht, so das mehrere Spiele in einer Liste angezeigt werden (table). =
Nun ist=20
mir der Gedanke hinzugekommen doch noch die M=F6glichkeit einzubauen, =
einen=20
Download anzubieten. Nun das 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 also=20
das wenn in der Datenbankspalte keine Pfad angegeben ist, er in der =
Tabelle den=20
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 =3D=20
$files[3];<BR> $download =3D=20
$files[4];<BR> }<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 der=20
Datenbank eine URL angegeben ist, der Pfad angezeigt werden, wenn der =
Table in=20
der Datenbank jedoch leer ist, m=F6chte ich ein n/a da haben. Was kann =
ich tun,=20
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></BODY></HTML>
------=_NextPart_000_0044_01BF5862.787F2120--
php::bar PHP Wiki - Listenarchive