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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T14:34:04+00:00 2026-06-16T14:34:04+00:00

I have 3 different databases which I want to get information from upon request.

  • 0

I have 3 different databases which I want to get information from upon request.

CREATE TABLE IF NOT EXISTS `catbreeds` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `information_breed` varchar(30) NOT NULL,
  `information_breed_seo` varchar(30) NOT NULL,
  `information_ems` varchar(4) NOT NULL,
  `information_ipaddress` text NOT NULL,
  `fact_head` text NOT NULL,
  `fact_ears` text NOT NULL,
  `fact_eyes` text NOT NULL,
  `fact_eyecolor` text NOT NULL,
  `fact_body` text NOT NULL,
  `fact_legs` text NOT NULL,
  `fact_paws` text NOT NULL,
  `fact_tail` text NOT NULL,
  `fact_coat` text NOT NULL,
  `fact_extra` text NOT NULL,
  `date_added` datetime NOT NULL,
  `date_edited` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `id` (`id`)
)

CREATE TABLE IF NOT EXISTS `catbreeds_personality` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `information_name` varchar(50) NOT NULL,
  `information_name_seo` varchar(50) NOT NULL,
  `information_ipaddress` text NOT NULL,
  `date_added` datetime NOT NULL,
  `date_edited` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `id` (`id`)
)

CREATE TABLE IF NOT EXISTS `catbreeds_personality_links` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `id_breed` int(10) DEFAULT '0',
  `id_personality` int(10) DEFAULT '0',
  `information_ipaddress` text NOT NULL,
  `date_linked` datetime NOT NULL,
  `date_edited` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `id` (`id`)
)

In the source code, I loop the personalities from the catbreeds_personality database. Every personality are linked on the website and when I click on each of the links, the list with catbreeds (fetched from the list in the catbreeds database) will be sorting the cat breeds after the personalities I have chosen.


Example

There is 2 cat breeds in the catbreeds database; Burmilla and Abessinier.

The catbreeds_personality database has 4 personalities; Social, Playful, Active, and Curious.

The catbreeds_personality_links database has 3 linked personalities; Social, Playful, and Curious.

On the website, when the visitor clicks on the link for Cursious the breed Burmilla will show and Abessinier will hide. If the personality Social and Playful are clicked, the breed Abessinier will show and the other breed will hide. And so on. I hope you’re getting how it all will work.


The only problem here is that I don’t know how the SQL looks like for this. At the moment my SQL query looks like this:

SELECT * FROM catbreeds AS cb, catbreeds_personality AS cbp, catbreeds_personality_links AS cbpl
WHERE cbp.id = '6'
AND cbpl.id_breed = cb.id
ORDER BY cb.information_breed ASC

The SQL query returns 4 results which doesn’t even have the ID number 6.

How can I solve this problem?

Thanks in advance.

  • 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-16T14:34:05+00:00Added an answer on June 16, 2026 at 2:34 pm
    SELECT * FROM catbreeds_personality_links AS cbpl
    INNER JOIN catbreeds AS cb ON cbpl.id_breed = cb.id
    INNER JOIN catbreeds_personality AS cbp ON cbpl.id_personality = cbp.id
    WHERE cbp.id = '6'
    ORDER BY cb.information_breed ASC
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have 2 different databases. Upon changing something in the big one (i don't
Basically I have 2 SQL queries from 2 different databases and I am trying
I have two databases at two different places, both databases are same with table
HI i have a peice of code which takes information from a xml file
I was hoping to get some advice. I want to create an application which
I have 5 databases which represent different regions of the country. In each database,
I'm trying to create a variable which is dependent on some information from the
Hi i have a class which contains different methods for checking database values. Each
I have nine different databases representing companies, all on the same SQL server 2008
I am using SQL Server 2008 R2. I have created two different databases Master

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.