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

Recommended Answers

All 2 Replies

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.

Thanks, I'll give that a try.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.