I have a repeating section from a MySQL look-up - the code (including HTML) is this:
<br>
<?php do { ?>
<?php if (substr($row_mDetails['Lo'], 0, 1) === '-') {echo str_replace('.', '', number_format($row_mDetails['Lo'], 5));} else {echo '+'.str_replace('.', '', number_format($row_mDetails['Lo'], 5));}; ?> |
<?php if (substr($row_mDetails['La'], 0, 1) === '-') {echo str_replace('.', '', number_format($row_mDetails['La'], 5));} else {echo '+'.str_replace('.', '', number_format($row_mDetails['La'], 5));}; ?>
| <?php echo $row_mDetails['Name']; ?> | 0 |<br>
<?php } while ($row_mDetails = mysql_fetch_assoc($mDetails)); ?>
How do I get the output of this to a string (for example, $MyDataString = *the output from the above*
)
Whenever I try this, I get the error:
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING
(Edited to include surrounding HTML)