Page 1 of 1

not sure of correct syntax

Posted: Thu Feb 12, 2004 8:22 am
by nutstretch
I am outputting my results to a table and would like to have more than one line of text in a cell. ie the address. Does anyone know what the syntax is I tried:

print '<td>'.$row2['RetailerName'].'</n>';
print .$row2['RetailerAdd1'].'</n>';
print .$row2['RetailerAdd2'].'</n>';
print .$row2['RetailerAdd3'].'</n>';
print .$row2['RetailerTown'].'</n>';
print .$row2['RetailerCounty'].'</n';
print .$row2['PostCode'].'</td>';

but I got a parse error.

should I have something before the .$row2 part like with the '<td>'

any help appreciated

Posted: Thu Feb 12, 2004 8:31 am
by twigletmac
Try this:

Code: Select all

<?php

print '<td>'.$row2['RetailerName'].'<br />';
print $row2['RetailerAdd1'].'<br />';
print $row2['RetailerAdd2'].'<br />';
print $row2['RetailerAdd3'].'<br />';
print $row2['RetailerTown'].'<br />';
print $row2['RetailerCounty'].'<br />';
print $row2['PostCode'].'</td>'; 

?>
The HTML linebreak tag is <br /> as opposed to </n> and you shouldn't have the concenation characters in front of the print statements.

Mac