0

In the following code, why is neither "Connected Successfully" nor "Connection failed" ever displayed on my page?
Also, I'm trying to place for table side by side in one large table. Does anyone have any idea why Eclipse is giving
me warnings about my four tables and my comments? Thanks.

<html>
  <head>
    <title>BCCX Pop Count</title>

    <link rel="stylesheet" type="text/css" href="style.css">
  </head>
  <body>
  <h1>BCCX Pop Count</h1>
    <table style="width: 100%; border: 1px solid black;">
      <tr>
        <th id='courts'>Courts</th>
        <th id='medical'>Medical</th>
        <th id='pun'>PUN</th>
        <th id='temp'>TEMP</th>
      </tr>
        <?php 
          // connect to database
          $servername = 'localhost';
          $username = 'me';
          $password = 'password';

          // create connection
          $connection = new mysqli($servername, $username, $password);

          // check connection
          if($connection->connect_error)
          {
            die("Connection failed: " . $connection->connect_error);
          }
          echo "Connected successfully";
        ?>
      <tr>
        <td>
          <table>
            # courts
          </table>
        </td>
        <td>
          <table>
            # medical
          </table>
        </td>
        <td>
          <table>
            # pun
          </table>
        </td>
          <table>
            # temp
          </table>
        </td>
      </tr>

    </table>
  </body>
</html>




Description Resource    Path    Location    Type
Invalid text string (
            # courts
          ).    index-popcount.php  /PopCount   line 34 HTML Problem
Description Resource    Path    Location    Type
Invalid location of tag (table).    index-popcount.php  /PopCount   line 48 HTML Problem
2
Contributors
2
Replies
18
Views
2 Years
Discussion Span
Last Post by lewashby
0

Your <table> tags are wrong. it is incorrect to do this:

<table>
some value
</table>

You need the <tr> and <td> elements as well. You also can't have a <table> positioned the way you have it at line 48.
Move your PHP code from where it is currently (between two <tr>'s) and put it at the top of the page. You might see different results.

0

Thanks, I'll give that a try.

Edited by lewashby: needed a change

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.