Re: php newbie having trouble going to list page
| From: | chris smith | Date: | Sun, 09 Apr 2006 01:07:53 +0000 |
| Subject: | Re: php newbie having trouble going to list page | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-233595@lists.php.net to get a copy of this message | ||
On 4/9/06, David Doonan <dadoonan@nycap.rr.com> wrote:
> I'm having trouble getting the correct results on a list page.
>
> The first query is pulling the name of active authors from the d/b
> and linking to a list page that is supposed to return essay titles by
> the requested author. The list page however is displaying essay
> titles by all authors.
> ---------------------
> List page query =
>
> $query_GetAuthorList = "SELECT Writings.Writings_Author,
> Writings.Writings_Title, DATE_FORMAT(Writings_Date, '%M %D, %Y') as
> Writings_Date, Writings.Writings_Text, Writings.ID,
> Author.Autholr_Name, Author.ID FROM Writings, Author
> WHERE Writings.ID = Writings.ID AND
> Author.Autholr_Name = Writings.Writings_Author AND
> Author.ID = Author.ID
> ORDER BY Writings.Writings_Date desc";
What happens when you run that through phpmyadmin or mysql? Does it
give you the right results?
You are right, the query seems to be stuffed - you have the tables
joining to themselves (author.id=author.id)
What do the tables look like?
describe writings;
describe author;
--
Postgresql & php tutorials
http://www.designmagick.com/