Hello,
I've started teaching myself PHP heavily after a big learning curve with design, html & css.
If you have a look at http://www.aftersunset.com.au/enquiry/test.php, its just a basic query from a database, what I'm looking to do is add an extra table column with a link such as
http://www.aftersunset.com.au/enquiry/test.php?id=1 which opens to a page which displays the comments or info that the user submitted which is also stored in the database (row is "comments")
<?php require_once('dbconnect.php');?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<head>
</head>
<body>
<?php
// query
$query = "SELECT * FROM enquiry";
// execute
$result = mysql_query($query) or die ("Error in query: $query. ".mysql_error());
// check for rows
if (mysql_num_rows($result) > 0) {
// yes
// print, repeat
echo "<table cellpadding=10 border=1>";
while($row = mysql_fetch_assoc($result)) {
echo "<tr>";
echo "<td>".$row['id']."</td>";
echo "<td>".$row['name']."</td>";
echo "<td>".$row['company']."</td>";
echo "<td>".$row['email']."</td>";
echo "<td>".$row['phone']."</td>";
echo "</tr>";
}
echo "</table>";
}
else {
// no
// error page
echo "No rows found!";
}
// free result set memory
mysql_free_result($result);
// close connection
mysql_close($connect);
?>
</body>
</html>
This is my first PHP script handwritten so it may be a little sloppy