We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26182
    • 164 Posts
    I am trying to join a few tables together but I keep getting the error "column id in field list is ambiguous". is there any way i can re-write this query so it works like is should?

    $sql= "SELECT {$fields} FROM {$table_content} table_content JOIN {$table_hits}  table_hits ON table_hits.page_id = table_content.id INNER JOIN {$table_users}  table_users ON table_content.createdby = table_users.id WHERE table_content.donthit = '0' ORDER BY table_hits.page_count DESC LIMIT 3";


    Please help!

    Thanks in advance,

    Sarah
      • 26182
      • 164 Posts
      I tried using another while loop inside the first while loop and two sql queries for a wild shot in the dark, but I’m still getting nothing.

      Please help!

      Thanks in advance.

      Sarah