1

I need to get the data of the database to an HTML table.

There were similar questions asked before but none of them were similar to my requirement.

I need to get the first row of the database to the first row of the table.

So I did this.

echo "<table id='main-table' border='1px solid'> <thead> ";
echo "<tr>";
                echo "<th>Board No</th>";
                 echo "<th>Number</th>";
 echo "</tr></thead><tbody>";

           while($query->fetch()){
                 echo "<form action='' class='' method='post'><tr>";
                   line 55 --> echo "<td>" . Board Code:".$row["board_code"] . Number:".$row["status"]  . "</td>";

                  echo "</tr> </form>";   
        }//End of While
  echo "</tbody></table>";

There is a syntax error in line 55 as mentioned above in the code.

1
  • String Concatination issue in same line 55. Commented Nov 23, 2018 at 4:42

3 Answers 3

3

Check this code:

echo "<table id='main-table' border='1px solid'> <thead> ";
echo "<tr>";
              echo "<th>Board No</th>";
               echo "<th>Number</th>";
echo "</tr></thead><tbody>";

         while($query->fetch()){
               echo "<form action='' class='' method='post'><tr>";
               echo "<td> Board Code:".$row["board_code"]. "</td>";
                echo "<td>Number:".$row["status"]. "</td>";
                echo "</tr> </form>";
      }
echo "</tbody></table>";
Sign up to request clarification or add additional context in comments.

Comments

0
 "<td>" . Board Code:".$row["board_code"] ." Number:".$row["status"]  . "</td>";

edit your code like if it does not work please share your whole code will help you for sure

Comments

0

Check with this code

echo "<form action='' class='' method='post'><tr>";
                   line 55 --> echo "<td>" . Board Code:".$row["board_code"] ." Number:".$row["status"]  . "</td>";

                  echo "</tr> </form>";   

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.