Re: select from two tables
| From: | JJ Harrison | Date: | Mon, 29 Jul 2002 07:41:55 +0000 |
| Subject: | Re: select from two tables | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-20849@lists.php.net to get a copy of this message | ||
I would try replacing:
echo"<i> by "; echo ($albumby[xoops_artist.artist]);
echo"<i><br>";
with this:
echo"<i> by "; echo $albumby[artist]; echo"<i><br>";
or even better this(notice the dots instead of different echos and the
single qoutes):
echo'<i> by '.$albumby[artist].'<i><br>';
I would say that you have a coloumn called artist in both tables. that is
why it echoing nothing.
I have also had trouble with SELECT * with cross-table joins.
I would replace it with the fields you need only. Like this:
SELECT * xoops_artist.artist, xoops_album.artist etc...
this would fixed the problem with coloumns with the same name also
--
JJ Harrison
webmaster@tececo.com
www.tececo.com
"Herman Verkade" <Herman.Verkade@iqware.co.uk> wrote in message
news:3124234FC567D51195560060979FF6ED094E71@muse.iqware.net...
>
> Well, I'm just a beginner myself, but I would say that:
>
> > echo"<i> by "; echo ($albumby[xoops_artist.artist]);
> > echo"<i><br>";
>
> should at least be:
>
> > echo"<i> by "; echo ($album[xoops_artist.artist]);
> > echo"<i><br>";
>
> or even:
>
> > echo"<i> by "; echo ($album[artist]); echo"<i><br>";
>
> Hope this helps,
>
> Herman