0

So I am trying to create a link that is inside my table. But How can I do this? I want the link to be on every row under the "update" heading. I have tried showing it on the browser, but it keeps on showing me this message "Parse error: syntax error, unexpected 'update' (T_STRING), expecting ',' or ';' in /home/unn_w19021796/public_html/movieQuery (5).php on line 70". Im not very good with this sort of stuff but if you could help me out, i'd appreciate it.

while ($rowObj = $queryResult->fetchObject()) {
        echo "<div class='movie'>\n
        <table>
        <thead>
        <tr>
        <td>Event ID</td>
        <td>Event Title</td>
        <td>Venue Name</td>
        <td>Category</td>
        <td>Event Start Date</td>
        <td>Event End Date</td>
        <td>Event Price</td>
        <td>Update</td>

        </tr>
        </thead>
        <tbody>
        <tr>
         <td><span class='eventID'>{$rowObj->eventID}</span>\n</td>
         <td><span class='eventTitle'>{$rowObj->eventTitle}</span>\n</td>
         <td><span class='venueName'>{$rowObj->venueName}</span>\n</td>
        <td><span class='catDesc'>{$rowObj->catDesc}</span>\n</td>
        <td><span class='eventStartDate'>{$rowObj->eventStartDate}</span>\n</td>
        <td><span class='eventEndDate'>{$rowObj->eventEndDate}</span>\n</td>
         <td><span class='eventPrice'>{$rowObj->eventPrice}</span>\n</td>
         <td><a href="update.php">Update</a></td>
        </td>
        </tr>
        </tbody>
        </table>
              </div>\n";
  • The quotes around `update.php` are breaking the quotes of the `echo`. You need to escape them. – Mureinik Jan 04 '20 at 22:40
  • @Mureinik thank you soo much, crazy to think a simple thing like that can just muck it all up ahahha. I appreciate this. thank you! –  Jan 04 '20 at 22:43
  • When outputting such a long piece of text, consider using [`heredoc`](https://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc) syntax. It will save you from having to worry about issues like this. – Nick Jan 04 '20 at 22:50

0 Answers0