echo "<td valign='top'>" . nl2br( $row['edition']) . nl2br( $row['publisher']) . nl2br( $row['date']) ."</td>";
This displays the data from the three fields in the table cell, but there's no space between the data, or linebreaks, so it's pretty difficult to read. I've tried replacing the n12br's with <br />, and also tried \n, but PHP's not happy with those at all and displays syntax errors.
I wouldn't normally have set the cell up like that, concatanating all the strings - normally I'd simply echo the HTML and variables like so,
echo "<td>$edition<br />$date<br />$publisher</td>\n";
which I've tried to do with this, but it's not playing. Rather than doing it all the long way and coding it all myself I tried to save some time and used a CRUD scaffolding generator, and this is the way it's given the code for each cell:
echo "<td valign='top'>" . nl2br( $row['isbn']) . "</td>";
As I wanted the data from three of the fields in the same cell, I've edited the table slightly and tried to put the three fields in one cell myself, but I've never used n12br() before (didn't know it existed or what it did until a couple of hours ago!). When I try to put all the three fields in one cell though as in my first code example I get a variety of PHP syntax errors, depending on whether I've tried substituting <br />, \n, or tried putting a space or comma between the variables.
Can anyone advise what's the correct way to do this please?