RE: [PHP-DB] JOIN operations
| From: | Rick Emery | Date: | Mon, 12 Nov 2001 17:34:01 +0000 |
| Subject: | RE: [PHP-DB] JOIN operations | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-14256@lists.php.net to get a copy of this message | ||
> There isn't the field table_name.ID_city!!!
because you didn't ask for it. You asked for:
table_name.name
table_city.ID
table_city.city
-----Original Message-----
From: Carlo Loiudice [mailto:porcapuzza@yahoo.it]
Sent: Friday, November 09, 2001 4:02 PM
To: PHP DB
Subject: [PHP-DB] JOIN operations
Hi,
I'm preforming a join between 2 Mysql tables in this
way:
table_name: ID,name,ID_city
table_city: ID,city
when I query this:
"SELECT table_name.name,table_city.ID,table_city.city
FROM table_name,table_city WHERE
table_name.ID_city=table_city.ID"
The result is a new table with this fields:
result_table: name,city.
There isn't the field table_name.ID_city!!!
Here's the question: I need also this field ID_city
because there's a function that builds a list box with
all the cities, and search for a html hidden input
named ID_city (like the table field) to eventually
highlight that entry.
can someone help me?
is there a way to select also the ID_city field
without break the join mechanism ?
Carlo
______________________________________________________________________
Abbonati a Yahoo! ADSL con Atlanet!
Naviga su Internet ad alta velocità, e senza limiti di tempo!
Per saperne di più vai alla pagina http://adsl.yahoo.it
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
For additional commands, e-mail: php-db-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net