not sure of correct syntax

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
nutstretch
Forum Contributor
Posts: 104
Joined: Sun Jan 11, 2004 11:46 am
Location: Leicester

not sure of correct syntax

Post 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
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post 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
Post Reply