Re: How to display field after MySQL join.

From: Date: Thu, 26 Dec 2002 07:04:13 +0000
Subject: Re: How to display field after MySQL join.
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-129345@lists.php.net to get a copy of this message
On Thursday 26 December 2002 07:25, Stephen of Blank Canvas wrote: > Hi Everyone, > > I'm trying to display the content of two mysql tables on a single page, > I have successfully joined them with the following statement. > > $query = "SELECT serv.*, cat.* FROM site_services AS serv, > site_servicescat AS cat WHERE serv.servicescat_id = cat.servicescat_id > AND serv.theme_id = $DomainTheme AND serv.status = 1 ORDER BY RAND() > LIMIT 3"; > > This works great but my problem is I have a field in each table called > "title", if I use the normal function of $row[title] I get field from > the "site_services" table but I cannot work out how to get the > "site_servicescat" title field. I have tried $row[cat.title] but all I > get is errors. > > Any help would be really appreciated as I think it's just me missing > something basic. print_r($row) to see what you have. -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* disbar, n: As distinguished from some other bar. */

« previous php.general (#129345) next »