我的PHP代码输出sql的问题

Hey guys im trying to connect to an database and collect some data out of the table zuordnung but it doesn't work correct everything i get is a white page im frustated because i can't find the error mabye another pair of eyes sees it so here is what i have so far:

<html>
 <head>
  <title>PHP Test</title>
 </head>
 <body>
 <?php
    include ("db_login.php");

    $link = mysql_connect($host, $user, $pass) or die ("Keine Verbindung zu der Datenbank moeglich.");
    mysql_select_db($db, $link);

    $sql = "SELECT ID_Zuordnung, HW_Typ, Hostname_alt, Username, Emailadresse, Datum_Ausgabe, Abteilung 
        FROM zuordnung
        WHERE Status_Tausch='OK' AND Status_Altgeraet='NOK'
        ORDER BY Hostname_alt;";

    $result = mysql_query($sql);
    $resultarray = mysql_fetch_array($result); 
            echo('<p>'.$resultarray['HW_Typ']."</p>");
            echo('<p>'.$resultarray['Hostname_alt']."</p>");
            echo('<p>'.$resultarray['Username']."</p>");
            echo('<p>'.$resultarray['Emailadresse']."</p>");
            echo('<p>'.$resultarray['Datum_Ausgabe']."</p>");
            echo('<p>'.$resultarray['Abteilung']."</p>");
    ?> 
 </body>
</html>
查看全部
douyi1341
douyi1341
2012/10/08 12:59
  • php
  • sql
  • 点赞
  • 收藏
  • 回答
    私信
满意答案
查看全部

3个回复