I'm trying to learn how to join tables, but I'm doing
something wrong. I've found lots of examples that look
easy, but something isn't clicking.
I think part of the confusion stems from the dynamic
tables I was creating with Dreamweaver. I thought they
were a necessary part of the equation, when they may
in fact be optional.
At any rate, I wondered if anyone on this list would
be willing to translate the code I've appended into
two joins that I can use as working examples.
Let's say we're working with two tables, named
"continents" and "nations," each with four columns, as
follows:
TABLE CONTINENTS
Name
Type
Group
CCode
TABLE NATIONS
Name
Type
NCode
CCode
And here are the two types of joined tables I'd like
to learn how to display:
1. A table displaying all four columns from Table
Nations, plus a 5th column - Table Continent's Group
column.
2. A table displaying both tables side by side - 8
columns, beginning with Table Continent's Name column
and ending with Table Nation's CCode column.
To illustrate my database connection, I copied the
code from my page, but stripped out almost everything,
including the dynamic table:
<?php require_once('../../../Connections/World.php');
?>
<?php
mysql_select_db($database_World, $World);
$query_Nations = "SELECT * FROM nations";
<!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"
xml:lang="en" lang="en">
<head>
</head>
<body>
</body>
</html>
If I can get SOME kind of join working on one of my
pages, then I ought to be able to figure out some
other varieties.
Thanks!
__________________________________
Do you Yahoo!?
SBC Yahoo! - Internet access at a great low price.
http://promo.yahoo.com/sbc/
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]