0

I have the following piece of code:

 <?php
 $con=mysqli_connect("host","user","pass","dbname");
    // Check connection
    if (mysqli_connect_errno())
    {
    echo "Failed to connect to MySQL: " . mysqli_connect_error();
    }

    $result = mysqli_query($con,"SELECT * FROM Elevi");

    echo "<table border='1'>
    <tr>
    **<th class="right-middle h_user">Nume</th>,** 
    <th class="right-middle h_done">Teme facute</th>,
    <th class="right_middle h_check"><img src="img/h_check.png"></th>,
    <th class="right-middle h_undone">Teme nefacute</th>,
    <th class="right-middle h_uncheck"><img src="img/h_uncheck.png"></th>,
    </tr>";

    while($row = mysqli_fetch_array($result))
    {
    echo "<tr>";
    echo "<td class="right-middle user">" . $row['Nume'] . "</td>";
    echo "<td>" . $row['Teme facute'] . "</td>";
    echo "<td>" . "<img src="img/check.png">" ."</td>";
    echo "<td>" . $row['Teme nefacute'] . "</td>";
    echo "</tr>";
    }
    echo "</table>";

    mysqli_close($con);
    ?>

I get the error that i am missing a ','(comma) or ';' (semicolon) on the line with stars around it.Can anyone please help me correct it? As you see, i tried adding a comma but i get the same error.

Alex Resiga
  • 71
  • 1
  • 11
  • Just look at the syntax highlighting here, you already see it then, that you have to escape your double quotes in the string. – Rizier123 Dec 14 '15 at 19:32
  • Instead of escaping double quotes, it would be easier to use single quotes for the ``echo``s. This way the HTML code is better readable. – Guido Kitzing Dec 14 '15 at 19:45

0 Answers0