I am working on a project for school, designing a website. I am trying to start small and make a basic message board.
I simply have users post a "name" "subject" and "message" to the mySQL database. This works fine.
I have done an echo statment to list the "messages" and that will just list them straight down. Now i want to be able to show all the columns of the sql table in my html page. I am having a lot of trouble trying to echo multiple columns at a time.
I want to echo a HTML table that has cells, one for the name,subject, and message. The end result would be a webpage that has a list of several HTML tables that have the information from the mySQL database
Here is my code:
$dbcnx = mysql_connect("localhost", "**", "****");
mysql_select_db("music", $dbcnx);
$groups = mysql_query("select from mboard", $dbcnx);
while ($row = mysql_fetch_array($groups)){
$name = $row["name"];
$subject = $row["subject"];
$message = $row["message"];
echo("$name . $subject . $message" . "<br>");
}
?>
I am also trying to echo the HTML table with that information:
echo("<table border="1" cellspacing="1" width="500"><tr><td width="100" rowspan="2" >" . $name . "</td><td width="400">" . $subject . "</td></tr><tr><td width="400">" . $message . "</td></tr></table>");
thank you for you help