SELECT t1.name, t2.name FROM table1 AS t1, table2 AS t2 WHERE t1.id =
t2.id
 
Are you looking for that form?
 
Warmest regards, 
 
Peter Sawczynec 
Technology Dir.
Sun-code.com 
Web related services 
646.316.3678 
[EMAIL PROTECTED]

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED]
Sent: Wednesday, February 14, 2007 8:42 AM
To: [email protected]
Subject: [Norton AntiSpam] [mysql] Syntax / PHP



Hi, 

Hope everyone forgives a rookie question. I am very new to PHP and are
just starting to use it in the developments of my web components. I have
been using MySQL for about two years now and love it. 

The question I had was one of syntax. I am trying to echo out a lists of
sections, districts, and buildings. All of these are in their own
tables. My problem comes up with "$Section = $row[Name];". The tables I
have are the following with the field 'Name' appearing in each table: 

`section`.`Name` 
`district`.`Name` 
`building`.`Name` 

Then I have: 

$Section = $row[Name]; 
$Building = $row[Name]; 

See my problem? "Name" is the same field name in two different tables. I
tried to do something like: 

$Section = $row[`section`.`Name`]; 

As you can imagine when I echo that out all I get is $Building. Am I
missing some basic syntax, or is there a better methodology that I
should be utilizing? 

If anyone wouldn't mind helping out a rookie I'd much appreciate it.
Thanks! 

PS: Further down my query I do have several LEFT JOIN's that link up the
tables based upon their keys (`section`.`Section_Num`, etc.) 

****************************
Sincerely,
Gary R. Ciszewski
Automation Support Librarian
WNY Regional Information Center
Erie 1 BOCES
355 Harlem Road
West Seneca, NY 14224
PH:(716) 821-7202
PH: 1-800-872-0780, x7202
FX:(716) 821-7498
[EMAIL PROTECTED]
"The world is not enough."
http://wnyslscat.wnyric.org
http://erie1sls.wnyric.org
------------------------------------------------------------------


_______________________________________________
New York PHP Community MySQL SIG
http://lists.nyphp.org/mailman/listinfo/mysql

NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com

Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php

Reply via email to