2017-11-23 5 views
0

私は変更を加えましたが、それらは同じテーブルにありますが、正しい列の下にはなく、アドレスは完全にレンダリングされません。それは、数字であり、残りの部分を離れる最初の単語を取っているように見えます。<tr>のデータを1つのヘッダーだけのテーブルに入れようとしました

enter image description hereそれは

$header = false; 

    $result = mysqli_query($db, "CALL Webc") or die("Query fail: " . mysqli_error()); 


    while ($row = mysqli_fetch_assoc($result)){ 
    if ($header == false) { 
     echo "<table border=1> 
      <th>Customer ID</th> 
      <th>Active</th> 
      <th>TDate</th> 
      <th>Student Type</th> 
      <th>First Name</th> 
      <th>Last Name</th> 
      <th>Address</th> 
      <th>City</th> 
      <th>State</th> 
      <th>Zip</th> 
      <th>UserName</th> 
      <th>Email</th> 
      <th>Password</th>"; 


     $header = true; 
    } 
    echo "<form action=update_students.php method=post>"; 

    echo "<tr><td>" . "<input type=text name=CustomerID value=" .$row["CustomerID"]. " </td></tr>"; 
    echo "<tr><td>" . "<input type=text name=active value=" .$row["active"]. " </td></tr>"; 
    echo "<tr><td>" . "<input type=text name=TDate value=" .$row["TDate"]. " </td></tr>"; 
    echo "<tr><td>" . "<input type=text name=StudentType value=" .$row["StudentType"]. " </td></tr>"; 
    echo "<tr><td>" . "<input type=text name=FirstName value=" .$row["FirstName"]. " </td></tr>"; 
    echo "<tr><td>" . "<input type=text name=LastName value=" .$row["LastName"]. " </td></tr>"; 
    echo "<tr><td>" . "<input type=text name=Address value=" .$row["Address"]. " </td></tr>"; 
    echo "<tr><td>" . "<input type=text name=City value=" .$row["City"]. " </td></tr>"; 
    echo "<tr><td>" . "<input type=text name=State value=" .$row["State"]. " </td></tr>"; 
    echo "<tr><td>" . "<input type=text name=Zip value=" .$row["Zip"]. " </td></tr>"; 
    echo "<tr><td>" . "<input type=text name=Email value=" .$row["Email"]. " </td></tr>"; 



     echo "<td>". "<input type=submit name=update value=update>". "</td>"; 
    echo "<td>". "<input type=submit name=delete value=delete>". "</td>"; 



     echo '<br />'; 
    echo "</form>"; 
    } 
+0

を書かれるべき一つのテーブルにそれらを必要正しいヘッダー名の下の正しい列の正しいデータが私の意図したものです。 – user3093389

+1

言語タグも追加します(php?)。これは有効なHTMLではないので、タグは閉じてください.thタグとtdタグはtrタグで、テーブルはhttps://www.w3schools.com/html/html_tables.aspの形式にする必要があります – Slai

答えて

1

は、ここでは、ここ で逃した出力で、あなたのコードからexpampleです:

echo "<tr>" . "<input type=text name=CustomerID value=" .$row["CustomerID"]. " </tr>"; 

echo "<tr><td>" . "<input type=text name=CustomerID value=" .$row["CustomerID"]. " </td></tr>"; 
+0

ありがとうございますわずかに改善されていますが、2番目の列「アクティブ」はヘッダーの下に「はい」が表示されますが、「CustomerID」のすぐ下に表示されます。次の列にインクリメントする方法はありますか? – user3093389

+0

html私はそれを解決する方法を見つけることができます。 –

+0

これはすべてのテーブルにありますが、水平ではありません。どうすれば正しい列に入れるのですか? – user3093389

関連する問題