Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8601277
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T01:48:19+00:00 2026-06-12T01:48:19+00:00

I crawled some datas from a web then directly save them in database, so

  • 0

I crawled some datas from a web then directly save them in database, so I got $title, $url, and $author. But, the number of $author for one title can more than 1 data. So, I separated $author from $title and $url. all id is auto increment.

tb_wrapper            tb_author
=================     ==================
|id| title | url|    |id|author|$title|
=================     ==================
|1 |titleA |urlA|    | 1| A    |titleA|
=================     | 2| B   |titleA|
                    ===================

in the other process(from document files that I got that their filename is same with $title), i have a table also that contain $title : tb_doc

======================
|id | content | title|
======================
|1  | contentA|titleA|
======================

I need to get datas from those 3 tables, so I can get the result like :
titleA has URLA contentA and author A and B

here’s the code :

$query = mysql_query("SELECT
                            tb_wrapper.url,
                            tb_wrapper.title,
                            tb_author.title,
                            tb_author.author,
                            tb_doc.content,
                            tb_doc.title
                       FROM
                            tb_doc
                       INNER JOIN tb_wrapper ON tb_doc.title = tb_wrapper.title
                       INNER JOIN tb_author ON tb_wrapper.title = tb_author.title ");

But, from that, I got duplicate result, author A and B are separated. please, help me, what join I have to do ? thank you very much 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T01:48:21+00:00Added an answer on June 12, 2026 at 1:48 am

    Use GROUP_CONCAT like so:

    SELECT w.url, w.title, a.title, a.authors, 
      d.content, d.title
    FROM tb_doc d
    INNER JOIN tb_wrapper w  ON d.title = w.title
    INNER JOIN
    (
       SELECT title, GROUP_CONCAT(author SEPARATOR ', ') AS authors
       FROM  tb_author
       GROUP BY title
     ) a ON w.title = a.title
    

    SQL Fiddle Demo

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to put some sites i crawled into a shelve, but the shelve
these day im making some web crawler script, but one of problem is my
I crawl some data from the web, because there is no API. Unfortunately, it's
I'm writing an application to crawl some websites and scrape data from them. I'm
I recently got interested in web crawlers but one thing isn't a very clear
I used nutch 1.4 and crawled a website. I got the website crawled successfully
I am creating a website in asp.net but i have some issue.. I have
The baidu spider seems to be adding ¤ to end of some crawled urls
I crawled some blogs for my project and extracted a few features, like length
I've just set up Solr, indexed some pages (crawled using Nutch) and I can

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.