SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: wrong method?

  1. #1
    Almeaty Member
    Join Date
    Jul 2000
    Location
    Nowhere
    Posts
    278
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question

    SELECT * FROM table1,table2 WHERE table1.id = $id AND table2.pid = table1.id

    the code above loads all info out of table1 and table2.

    Now when I parse the id with the URL ../something.php3?id=1 the page doesn't display anything from the tables...
    However after I have filled some cells into table2 with a pid..only then all info appears. Whats up?

  2. #2
    Serial Publisher silver trophy aspen's Avatar
    Join Date
    Aug 1999
    Location
    East Lansing, MI USA
    Posts
    12,939
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm not going to go into detail but....

    I think you would benefit from reading up on and instituting some JOINS. Kevin covered them in his PHP/MySQL article on this site.

    Chris


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •