![]() |
[PHP] Datenbankausgabe ist N
Hi,
mal wieder PHP: Der folgende SourceCode soll mir eigentlich den Link aus einer Datenbank holen, aber "$row[charFile]" ist immer "N". In der Datenbank steht aber ein ordentlicher Link. Kann mir da jemand weiterhelfen?
Code:
Chris
<?php
$relative_path = "./"; $small_title = "Download"; $id = $HTTP_GET_VARS["id"]; if (empty($id)){ die("Kein Download angegeben"); } include("includes/connect.inc.php"); $link = ConnectAndSelect(); $queryString = "SELECT * FROM downloads WHERE intID = '$id'"; $result = mysql_query($queryString, $link); if (mysql_num_rows($result) != 1) { die ("MySQL-Download-Table-Error!"); } while ($row = mysql_fetch_array($result)) { ?> <?php include("includes/header.inc.php"); ?> [b]Download wird gestartet[/b]</p> Um den von Ihnen gewünschten Download zu starten, klicken Sie bitte auf den folgenden Link:</p> [url="<?php print $row[charFile]; ?>"]Download File[/url]</p> <?php include("includes/footer.inc.php"); }?> |
Re: [PHP] Datenbankausgabe ist N
Hi Chris, versuchs vielleicht mal so:
Code:
<?php
$relative_path = "./"; $small_title = "Download"; $id = $HTTP_GET_VARS["id"]; if (empty($id)){ die("Kein Download angegeben"); } include("includes/connect.inc.php"); $link = ConnectAndSelect(); $queryString = "SELECT * FROM downloads WHERE intID = '$id'"; $result = mysql_query($queryString, $link); if (mysql_num_rows($result) != 1) { die ("MySQL-Download-Table-Error!"); } while ($row = mysql_fetch_array($result,[b]MYSQL_ASSOC[/b])) { ?> <?php include("includes/header.inc.php"); ?> [b]Download wird gestartet[/b]</p> Um den von Ihnen gewünschten Download zu starten, klicken Sie bitte auf den folgenden Link:</p> [url="<?php print [b]$row['charFile'][/b]; ?>"]Download File[/url]</p> <?php include("includes/footer.inc.php"); }?> |
Sorry, hat nichts gebracht!
Chris |
Heißt die Spalte in der Tabelle wirklich charFile oder vielleicht CharFile oder sonst wie?
Oder benutz anstatt des Namens den Integer-Index im Array $row. Du musst dann allerdings im Aufruf von mysql_fetch_array die Konstante [i]MYSQL_ASSOC weglassen. |
Alle Zeitangaben in WEZ +1. Es ist jetzt 10:12 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz