Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I am trying to get this data to go into a table so I can view it better on my website and I dont really understand how to combing PHP and HTML and I was getting this error

Parse error: syntax error, unexpected ';'

I dont know if I combine them wrong so here is my code and tell me if I need to supply more than this line of code.

<h2>Featured Event's</h2>
<body>
<table cellpadding="10">
<tbody>
<?php echo ?><td><?php $eventname ?></td><?php echo?><td><?php $row_id ?></td><?php
share|improve this question
 
you can't echo out like that..its totally wrong. –  pjp Dec 12 '12 at 2:36
add comment

3 Answers

up vote 1 down vote accepted

You can either do that or do:

<td><?php echo $eventname ?></td><td><?php echo $row_id ?></td>

Or

<?php echo "<td>$eventname</td><td>$row_id</td>"; ?>
share|improve this answer
 
Thanks you made it work..again –  maxgee Dec 12 '12 at 2:37
add comment
<td><?php echo $eventname ?></td><td><?php echo $row_id ?></td>
share|improve this answer
add comment

You can't replace " with ?>. The ?> ends the PHP context and terminates whichever statement is open. Everything between <?php and ?> needs to be one or more complete statements.

Choose either of these:

<?php

echo "<td>$eventname</td><td>$row_id</td></tr>"

Or

<tr>
  <td><?= $eventname ?></td>
  <td><?= $row_id ?></td>
</tr>

You're also missing an opening <tr>, which isn't optional.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.