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

The Archive Base Latest Questions

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

SQL query to show all tool_tip_links related to pages_learn_more ID? How do I structure

  • 0

enter image description here

SQL query to show all tool_tip_links related to pages_learn_more ID?

How do I structure this query correctly?

 $SQL = 
    "SELECT ptt.tool_tip_link
    FROM pages_tool_tip ptt
    JOIN pages_to_pages ptp
    ON ptp.tool_tip_id = ptt.tool_tip_id
    WHERE ptp.learn_more_id = 2";

    $result = mysql_query($SQL); // or die(mysql_error()); 


     while ($db_field = mysql_fetch_array($result))
    {   
   $reference_keys   =     $db_field['tool_tip_link'];  
        }
      echo $reference_keys;

How do I combine these queries to make them clean and efficient? Thanks for the help..

————————————–UPDATE———————————-
Using this code:

    "SELECT ptt.tool_tip_link
    FROM pages_tool_tip ptt
    JOIN pages_to_pages ptp
            ON ptp.tool_tip_id = ptt.tool_tip_id
    JOIN pages_learn_more plm
            ON plm.id = ptp.learn_more_id
    WHERE plm.id = 2";

Should Show me 3 tool_tip_links. However it is only returning the last field in the DB which is 4 -> LINK 4

enter image description here

So how do i get all of the links, not just the last one?
ty again..

————————————–UPDATE———————————-

When I echo out mysql_num_rows it displays correctly stating 3 for id #2.

So what code do I need to display all three rows links? LOOP ARRAY? I don’t get it because It should already be looped in my array. Can i just echo $reference_keys or should I be doing something different?

I also tried a foreach and that returned an error. What am i doing wrong? please advise.

more db views –> hope it helps find a resolve..

this is the pages_learn_more table

this is the pages tooltip table

  • 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-07T12:34:35+00:00Added an answer on June 7, 2026 at 12:34 pm

    According to your criteria:

    SQL query to show all tool_tip_links related to pages_learn_more ID

    Here you go

    SELECT ptt.tool_tip_link
    FROM pages_tool_tip ptt
    JOIN pages_to_pages ptp
         ON ptp.tool_tip_id = ptt.tool_tip_id
    WHERE ptp.learn_more_id = :id
    

    :id is the variable here.

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

Sidebar

Related Questions

Original SQL query is this; SELECT id,post_title,post_date FROM wp_posts where id='1' When I retrieve
i have this sql query select * from table where name like ? but
SQL query: SELECT ArticleCategories.Title AS Category, Articles.Title, Articles.[Content], Articles.Date FROM ArticleCategories INNER JOIN Articles
SQL query which select the record from three tables and there is no relation
My sql query is as follows IF @StatusId = 10 BEGIN SELECT * FROM
My SQL query looks like this... sekect * FROM mail_headers a LEFT JOIN mail_headers_body
Under the my query.I select this way all job count by fullname. SELECT COUNT(sy.FullName)
Why does this sql query only show results if they only have a row
I have a SQL query which retrieve wall post list $qry=mysql_query(SELECT senderid,post,date FROM .post_table.
I have the following SQL query: SELECT Comment, JD, Jurisdiction, RegStatus, Region, SPDR_NAME FROM

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.