phpbar.de logo

Mailinglisten-Archive

[php] Hilfe

[php] Hilfe

Tobias Kuhrmann admin_(at)_hlweb.de
Thu, 6 Jan 2000 16:44:14 +0100


This is a multi-part message in MIME format.

------=_NextPart_000_006F_01BF5865.4426D500
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hallo,

ich nochmal, noch ein kleines Problem, folgendes geht nicht:
  if ($download =3D=3D "") $download =3D "N/A" else if ($download > 0) =
$download =3D "<a href=3D$download target=3Dnew><img =
src=3Dgfx/pfeil3.gif border=3D0></a>";

was ist daran falsch? Bitte noch diesen Gefallen...

Gruss,
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_006F_01BF5865.4426D500
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>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>ich nochmal, noch ein kleines Problem, =
folgendes=20
geht nicht:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;if ($download =3D=3D "") =
$download =3D "N/A"=20
else if ($download &gt; 0) $download =3D "&lt;a href=3D$download=20
target=3Dnew&gt;&lt;img src=3Dgfx/pfeil3.gif =
border=3D0&gt;&lt;/a&gt;";</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>was ist daran falsch? Bitte noch diesen =

Gefallen...</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Gruss,</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>&nbsp;</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&nbsp;$download =3D $files[4]; =
schreibe=20
  einfach</FONT></DIV>
  <DIV>&nbsp;</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>&nbsp;</DIV>
  <DIV>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2>lg Christoph Aigner</FONT></DIV>
  <DIV>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</DIV>
    <DIV><FONT face=3DArial=20
    =
size=3D2>&lt;?<BR>&nbsp;require("../php/dblogonHalflifeweb.php3");<BR>&nb=
sp;mysql_connect("$dbHost","$dbUser","$dbPassword");<BR>&nbsp;mysql_selec=
t_db("$dbName");<BR>&nbsp;$file=20
    =3D mysql_query("SELECT * FROM mods order by name");<BR>&nbsp;while =
($files =3D=20
    =
mysql_fetch_row($file))<BR>&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;$released =
=3D=20
    $files[1];<BR>&nbsp;&nbsp;&nbsp;$name =3D =
$files[2];<BR>&nbsp;&nbsp;&nbsp;$url=20
    =3D $files[3];<BR>&nbsp;&nbsp;&nbsp;$download =3D =
$files[4];</FONT></DIV>
    <DIV><FONT face=3DArial =
size=3D2>&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;print=20
    ("<BR>&lt;tr&gt;<BR>&nbsp;&lt;td =
nowrap&gt;<BR>&nbsp;&lt;center&gt;&lt;font=20
    color=3D#FFFFFF size=3D1=20
    face=3DVerdana&gt;$released<BR>&nbsp;&lt;/td&gt;<BR>&nbsp;&lt;td=20
    nowrap&gt;<BR>&nbsp;&lt;center&gt;&lt;font color=3D#FFFFFF size=3D1=20
    face=3DVerdana&gt;$download<BR>&nbsp;&lt;/td&gt;<BR>&nbsp;&lt;td=20
    nowrap&gt;<BR>&nbsp;&lt;font color=3D#FFFFFF size=3D1=20
    face=3DVerdana&gt;$name<BR>&nbsp;&lt;/td&gt;<BR>&nbsp;&lt;td=20
    nowrap&gt;<BR>&nbsp;&lt;font size=3D1 color=3D#FFFFFF =
face=3DVerdana&gt;&lt;a=20
    href=3D$url=20
    =
target=3Dnew&gt;$url&lt;/a&gt;<BR>&nbsp;&lt;/td&gt;<BR>&lt;/tr&gt;<BR>");=
<BR>&nbsp;&nbsp;}<BR>&nbsp;print=20
    =
("&lt;/table&gt;");<BR>&nbsp;mysql_close();<BR>?&gt;&lt;/ul&gt;</FONT></D=
IV>
    <DIV>&nbsp;</DIV>
    <DIV>&nbsp;</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>&nbsp;</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_006F_01BF5865.4426D500--



php::bar PHP Wiki   -   Listenarchive