Hello,
Posted this in newbie forum because I am positive that it is that type of question.
I have about 8 reference books on order but am still waiting for them.
I am looking for some help on formating the output of a query properly.
I went looking through the PHP manual and don't really see a good example of getting your results to "look good" when output to your web page.
All I'm really looking for is to make sure I have the column headings only once and that all of the results from the query get lined up underneath those headings. With my little snip below, I first got
Part Number
blah blah
Part Description
blah blah
over and over for each row
then I changed it so that I got:
Part Number Part Description
blah blah blah blah blah blah
I'm looking for
Part Number space Description
blah blah blah space blah blah blah
blah blah blah space blah blah blah
blah blah blah space blah blah blah
Example code
$myresult = pg_exec($conn, "SELECT * FROM parts");
while($row = pg_fetch_array($myresult)){
$PartNumber = $row['PartNumber'];
//$PartDesc = $row['2'];
$PartDesc = $row['PartDesc'];
//$PartNumber = $row['1'];
print("Part Number: Description:<br />\n");
print("$PartNumber $PartDesc<br />\n");
}
Thanks in advance,
Garry2004