Re: PHP/mySQL Query
| From: | Jay Paulson | Date: | Fri, 06 Jul 2001 00:13:40 +0000 |
| Subject: | Re: PHP/mySQL Query | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-56407@lists.php.net to get a copy of this message | ||
what you want to do is a join so it'd look something like this..
select teampages.ownerID, teampages.last_update, owners.teamname FROM
teampages, owners where teampages.ownerID= owners.ownerID ORDER BY
teampages.last_update DESC LIMIT 10
hopefully that will work! :)
jay
----- Original Message -----
From: "Jeff Lewis" <jeff@hyrum.net>
To: <php-general@lists.php.net>
Sent: Thursday, July 05, 2001 6:59 PM
Subject: [PHP] PHP/mySQL Query
> I fought the urge to post this here but have to :(
>
> I have two tables named like this:
>
> owners
> -ownerID
> -teamname
> -more fields
>
> teampages
> -ownerID
> -bio
>
> Anyway, I'm doing a select on the database like this: select ownerID,
> last_update FROM teampages ORDER BY last_update DESC LIMIT 10
>
> The thing is, I want to get the team name from the other table as well.
Can
> anyone help me out?
>
> Jeff
>