PHP, HTML and MySQL problems


I am creating a website with PHP, HTML and MySQL. In my PHP file I have connected to the MySQL database and have run queries to retrieve information that I want displayed on my website.

For example I have a page owners.html which retrieves information about users purchases and I want to display information from my owners.php page which contains this information?

Any ideas?


what have you got so far? eg have you got a database if so what fields do you want displayed and how do you want it displayed?

I have a mysql database which I have connected to the php.

In the database I have a table purchases with the fields amount, date and description

I would like this to be displayed in a table in the orders.html page



<?php $con = mysql_connect("localhost","root","password"); if (!$con) { die('Could not connect: ' . mysql_error()); }

mysql_select_db(“dbname”, $con);

$result = mysql_query(“SELECT * FROM purchases”);

while($row = mysql_fetch_array($result))
echo "

echo “";
echo “”;
amount date description
”.$row[‘amount’] . " " . $row[‘date’]." " . $row[‘description’]."

something like this should do it but you need to edit the database bit

Sponsor our Newsletter | Privacy Policy | Terms of Service