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 8478727
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T18:49:30+00:00 2026-06-10T18:49:30+00:00

I have these 2 queries and i would like to join them into one

  • 0

I have these 2 queries and i would like to join them into one but i am unsure of how to go about it.

Query 1:

$query = "SELECT * FROM ".$db_tbl_comics." WHERE ".$db_fld_comics_publisher."='".$pub_id."'
AND ".$db_fld_comics_active."='1' GROUP BY ".$db_fld_comics_arc;

Query 2:

$q2 = mysql_query('SELECT '.$db_fld_arcs_title.' FROM '.$db_tbl_arcs.'
WHERE '.$db_fld_arcs_id.'="'.$result[$db_fld_comics_arc].'"');

Comics Table:

CREATE TABLE IF NOT EXISTS `comics` (
  `id` varchar(255) NOT NULL,
  `arc` int(255) NOT NULL,
  `title` varchar(255) NOT NULL,
  `issue` decimal(5,1) DEFAULT NULL,
  `price` decimal(10,2) NOT NULL,
  `plot` longtext NOT NULL,
  `publisher` int(255) NOT NULL,
  `isbn` varchar(255) NOT NULL,
  `published` date NOT NULL,
  `cover` varchar(255) NOT NULL DEFAULT './images/nopic.jpg',
  `added` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `views` int(255) NOT NULL DEFAULT '0',
  `active` int(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `arc` (`arc`,`title`,`issue`,`publisher`)
);

Arcs Table:

CREATE TABLE IF NOT EXISTS `arcs` (
  `id` int(255) NOT NULL AUTO_INCREMENT,
  `title` varchar(255) NOT NULL,
  `plot` longtext NOT NULL,
  `added` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `title` (`title`)
);

What I need to do is get the Arcs Title from the arcs table for the respective comic arc.

  • 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-10T18:49:32+00:00Added an answer on June 10, 2026 at 6:49 pm

    You need to use INNER JOIN for that since I presume that records are present on both tables.

    SELECT  a.*, b.title
    FROM    comics a INNER JOIN arcs b
                on a.id = b.id
    WHERE   a.Title = 'VALUEHERE'
    

    displays all details from comics table and the title of the arc

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

Sidebar

Related Questions

I have these 2 queries that I would like to combine into one big
I have these two queries to test my output SELECT DISTINCT( providerId ), SUM((
I have these 3 tables: and I'm using this code to join them together
I have a number of custom find_by_sql queries in Rails. I would like to
I have a stock table and I would like to create a report that
I have two tables in my database, and I would like to retrieve information
I have two tables named users and contacts . I would like to delete
I have 3 queries which retrieves maximum value depending on a condition. select max(to_number(substr(attr_value,9)))+1
I'm a beginner in queries and I'm struggling with one of them. Here are
I have a 5×7 HTML table. On many queries, there are fewer than 35

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.