Result into array?

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
psurrena
Forum Contributor
Posts: 355
Joined: Thu Nov 10, 2005 12:31 pm
Location: Broolyn, NY

Result into array?

Post by psurrena »

The code below works except I don't need people_fname twice. Is there a way to store membership_name into an array through the query? If I do this through PHP it still shows people_fname twice.

Thanks!

Code: Select all

mysql> SELECT membership_name, people_fname
    -> FROM membership,people_membership,people
    -> WHERE membership.membership_id=people_membership.membership_id
    -> AND
    -> people.people_id=people_membership.people_id
    -> AND
    -> people_membership.people_id=3;
+-----------------+--------------+
| membership_name | people_fname |
+-----------------+--------------+
| AICP            | John         |
| PP              | John         |
+-----------------+--------------+
Post Reply