How to generate a HTML page to display PHP results

I had to create a database with a customer table table etc and then insert and retrieve data - I have that all working OK with the output showing correctly on the php page, but I have been asked to generate a HTML page to display the automatically generated orderid…?

I have used a HTML page to build the form and then a separate php page. My HTML page has: and I am using this php for the output:-

//fetch and display results
while ($row = mysql_fetch_array($results)) {
echo “

Given Name: $row[gname]

”;
echo “

Family Name: $row[fname]

”;
echo “

Email: $row[email]

”;
echo “

Order no: $row[orderid]

”;
echo “

You ordered $row[quantity] $row[item].

”;
echo “

Thank you for ordering from Art Supplies!

”;
}

Can anyone please tell me how I am suppose to generate a HTML page to view the orderid thanks.

Just do something like this:

[php]// other php-stuff

//fetch results
$data = array();
while ($row = mysql_fetch_array($results)) {
$data[] = $row;
}

// then load your template (should be a php file as well)
?>

<?php foreach ($data as $row) { ?>

Given Name: <?= $row[gname] ?>

Family Name: <?= $row[fname] ?>

Email: <?= $row[email] ?>

Order no: <?= $row[orderid] ?>

You ordered <?= $row[quantity] $row[item] ?>.

Thank you for ordering from Art Supplies!

<?php } ?>[/php]
Sponsor our Newsletter | Privacy Policy | Terms of Service