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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T14:07:08+00:00 2026-06-07T14:07:08+00:00

I have 2 tables. The parent table is learn_mor e and child table is

  • 0

I have 2 tables. The parent table is learn_more and child table is reference_keys
Both tables are innodb

reference_keys has two columns:
key_id [index]
key_href


learn_more table
id [primary]
keys_id [foreign key]
page_title    
page_content

What I am trying to do is get multiple links in the learn more table from the reference_keys table.
So example, learn_more table id:1, keys_id:1,3,4,8,13,25,…, page_title:Home Page: blah blah, page_content: blah blah……

The problem is that phpmyadmin will not allow me to put more than 1 id in the keys_id of learn_more.

//ERROR
//Warning: #1265 Data truncated for column ‘keys_id’ at row 1

I’m guessing the relation view is not setup correctly. – How do i fix this?

and on my page it shows the key_id in the echo instead of the value for the id: which is the key_href. so my page show “1” instead of the value for 1 which is a link..

Perhaps my sql query is not correct?

$SQL = "SELECT * FROM learn_more WHERE page_title = '$this_page'";
  • 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-07T14:07:10+00:00Added an answer on June 7, 2026 at 2:07 pm

    To build a many-to-many here is what you could do:

    reference_keys has two columns:
    key_id [index]
    key_href
    
    learn_more_to_reference_key
    reference_key_id [FK to reference_keys]
    learn_more_id [FK to learn_more]
    
    learn_more table
    id [primary]
    page_title    
    page_content
    

    Then you have essentially a 1:N on each side of the relationship. Notice that I removed the FK from the learn_more table, too.

    So to grab the relationship you’d query like this:

    SELECT * FROM Learn_More lm 
    INNER JOIN learn_more_to_reference_key lmtrk ON lm.id = lmtrk.learn_more_id 
    INNER JOIN reference_keys rk ON rk.id = lmtrk.reference_key_id
    

    I believe the inner join is correct, i’m double-checking that.

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

Sidebar

Related Questions

I have two tables a parent and a child table. The child table has
I have two tables Loan(Parent Table) and Receipt(Child table)what i want to do is
I have a table with two child tables. For each record in the parent
I have two tables with parent - child relationship: PARENT table with id as
I have two parent tables, BusinessGroup and SocialGroup, and one child table, Members. A
I have two tables like Parent-Child. In Parent table, there are 7211 records. In
I have two tables connected with one to many relationship. Parent Table is a
I have a simple parent/child tables. Contract is the parent table. Each contract can
I have two tables : Product and ProductRateDetail. The parent table is Product. I
I have two tables nested (master view) for representing my data. The parent table

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.